@danielcb
Dude, you don't quote the main post.
Ever.
About your doubt, I didn't get it.
@danielcb
Dude, you don't quote the main post.
Ever.
About your doubt, I didn't get it.
@Rahpael
Sorry man, jeje i already learned what i was asking for xD thanks for ur tutorial
Last edited by Dani Scripts; 02-26-2014 at 04:46 PM.
I would like to point out that while this is a great tutorial, there is something that wasn't mentioned as far as I could see.
And that is that lineedit values are ALWAYS returned as strings, so if you want to compared it to, lets say, $cap or itemcount() for example, you need to $cap <= tonumber(getuseroption("myoption"))
Small thing that might help newbies out
Is there any way to get the user option as a global variable?
adding it in a persistent hotkey will work as a global variable?
Last edited by Jesusz0r; 03-19-2014 at 11:29 PM.
How i change the ammount of manas to buy/leave on supplylist getting it from user options?
Did I explained myself?
Hello,
Is there any way to make and read settings like this?
JSON CODE:
And read it like this:Code:{ "type" : "group", "name" : "userings", "text" : "Ring Setup", "children" : [ { "type" : "checkbox", "name" : "stealthring", "text" : "Do you want to use a stealth ring?" }, { "type" : "spinbox", "name" : "ringamount", "text" : "Amount of rings to take", "min" : 1, "max" : 5, "value" : 3 }, { "type" : "spinbox", "name" : "ringmonsteramount", "text" : "Amount of creatures", "min" : 1, "max" : 10, "value" : 2 }, >>>> HERE THE TYPE OF CREATURES <<<< so they can choose which creatures, like Rats/Poison Spiders/Wolfs etc ] }
Monsters = {TYPE OF CREATURES}
Yours,
Hello @Raphael ,
I was searching the web trying to find out a bit more about jAson but I can't find any clear explenations/tutorials. (crying about all the info at w3c)
For example. the functionallity of:
{
"type": "scriptinfo",
"name": "Random Text",
"version": "1.0"
}
It's working because of how windbot reads and processes those values?
I mean type, name and version... not the values attached to them. just like child, min, max etc.
or can you put anything there if I'd use it outside of windbot?
Ty,
No, not really a way to do that. You could make it a lineedit widget, tell the user to input the names as a comma-separated list and simply do:
local Monsters = string.explode(getuseroption('...'), ',')
That doesn't give you much control over the input though and will probably cause you problems with users mistyping stuff.
JSON is simply a way to pass data. Theoretically, anything can go within it. The purpose though, is that each piece of software defines a basic structure so that a specific kind of data can be transferred following a common pattern