View Full Version : Add Action (scripting within the walker)
psychaos
02-03-2012, 10:00 PM
I really dont think the way scripts currently work within xenobot is very practical, and if im honest i find it a bit confusing. Also, if something isnt working and the script needs editing you have to locate the file and edit it in notepad. and i can see the script folder getting pretty messy as more features are added to the bot and we have several scripts saved.
I feel that it worked alot smoother in neobot, whereby you could just add an action waypoint, and write/edit the script within neobot.
I propose an "Add Action" option in the walker, which opens a text box where u can add the script right into the walker. And then a doubleclick to open the box again if it needs to be changed for any reason. No save files needed, and much easier to adjust things.
or is this not possible with xenobots design?
Spectrus
02-03-2012, 10:36 PM
It may be possible. My belief, however, is that any dialogue menu that he can make inside the Tibia client would provide a poor scripting interface. Perhaps the option to "Add Script" and when added, asks you to input a path to the script. I also agree that it should be possible to edit waypoints while logged in.
psychaos
02-04-2012, 12:03 AM
id take a poor scripting interface for ease of use any day.
besides, i fail to see what would be so bad about it anyway, the only thing it might lack is coloured text. the scripts would still be written in the same way surely?
Heardy
02-04-2012, 12:08 AM
As far as I know there's a limit of characters you can enter into any textbox before the clients starts to lag like hell.
Not sure tho.
psychaos
02-04-2012, 12:26 AM
well failing that, spectrus' suggestion is still an improvement.
Syntax
02-04-2012, 12:32 AM
this isn't neobot. A different structure does not make it worse. I prefer having it read scripts from the folder. I like to have syntax coloring and honestly making an entire IDE inside the client is not something Nick should waste his time on.
If you take a look at my alternative walker I do use labels as function names so you can call functions straight from the walker. That's the closest you will get.
Heardy
02-04-2012, 12:43 AM
Nevermind...
psychaos
02-04-2012, 12:52 AM
please explain to me how pulling each script from a file is better? what if you need something simple like a checkposition, you have to create an individual file for 2 or 3 lines of text. take into account how many files one depositing script might use, then times that by the number of different scripts we will eventually make. how will we be able to keep anything organized within the script folder.
Raphael
02-04-2012, 12:53 AM
this isn't neobot. A different structure does not make it worse. I prefer having it read scripts from the folder. I like to have syntax coloring and honestly making an entire IDE inside the client is not something Nick should waste his time on.
If you take a look at my alternative walker I do use labels as function names so you can call functions straight from the walker. That's the closest you will get.
Let's be honest, it's not the end of the world, but it's indeed worse. Separating it only makes it harder to manage and maintain. While, of course, it's probably impractical to develop something like this under the current structure, you can't take it as an excuse, but rather as a design flaw.
Spectrus
02-04-2012, 12:53 AM
Syntax's system works like this. You add a label that says 'Self.Say("exura")'. That command is executed. No need for a file.
psychaos
02-04-2012, 01:03 AM
i get how ur label thing works, but that should be a built-in function. if this bot is ever going to become popular it needs to be user-friendly, which right now it is not. even redbot is easier to use, and that was made by some stupid brazillian. the only reason i choose not to use redbot right now is because i dont feel that it is safe, and i wouldnt trust anything that came out of brazil.
Syntax
02-04-2012, 01:09 AM
Why does it need to be built in. It's works fine the way it is. Just put all your functions in one file and name the labels of the function you want to execute. Easy.
Raphael
02-04-2012, 01:09 AM
i get how ur label thing works, but that should be a built-in function. if this bot is ever going to become popular it needs to be user-friendly, which right now it is not. even redbot is easier to use, and that was made by some stupid brazillian. the only reason i choose not to use redbot right now is because i dont feel that it is safe, and i wouldnt trust anything that came out of brazil.
fuck you now, you retard. you used neobot, and 90% of its content came from brazil.
psychaos
02-04-2012, 01:34 AM
my point is, not everyone has experience with scripting. it might do the job just fine for YOU, but the average person isnt gona have a clue. this bot is gona go nowhere unless it is made more user friendly.
Bashy
02-04-2012, 01:46 PM
Raphael, did that hit a nerve? Fancy a cuddle?
DarkstaR
02-04-2012, 02:20 PM
*Loling*
The scripting interface will remain as it is. While I MIGHT add the possibility to configure inline scripts into the walker, it will be very crude. Tibia's current textboxes don't support tabbed input or anything similar, and coding a box like that completely from scratch will be a highly tedious and time consuming job. If anything, for inline scripts, you're looking at something like the label box with a little more room. This means that any intensive inline-scripts would look like this:
setWalkerEnabled(false) if (var == value) then doAction(param1, param2, param3) else doAction(param1, param2, param3) end setWalkerEnabled(true)
Not only is it very uneasy on the eyes, but it also wouldn't even fully show itself inside the listbox, not to mention is less user-friendly (in my opinion) than the current system. Currently, you can create an entire depositor script in a single .LUA file. This fact is what leaves me unsure as to where people are obtaining their information since they all seem to believe otherwise.
The other problem that arises is that scripts execute in their own threads - once executed the walker would not wait for them to finish. While this can be a bit bitchy even with the current system, simultaneous processing would equate to a loss of functions such as wait()/sleep(). Furthermore, any processor expensive scripts would lag all of Tibia, since all of XenoBot's internal operations are executed on Tibia's main thread for data synchronism.
I understand many of you are complacent and will ultimately long for something like NeoBot until you learn something new. However, this is XenoBot. Yes, XenoBot has quite a few places where it falls short. It also, however, overtakes neobot in other aspects of its functionality. While few of those are currently visible, they will be soon. And the next person to call this bot unuserfriendly needs to go remind themselves how they had to set up combo attack in Neo. Hell, even the recasting of spells and such - talk about multiple LUA scripts.
TL;DR - You're already using a bot that's nearly able to do everything for you, stop bitching about having to set it up just one time to make that happen.
PS - That TL;DR was not at all a summary of what I said. If you care about a real informative post, actually read it, bro.
sk8er08
02-04-2012, 03:51 PM
Another possibility could be adding a way to create a library of functions, then in the action waypoint you just input the function you want so for example:
I am too lazy to actually write a functional script so I am just going to summarize.
function buyPots(amount)
say "hi"
npcsay "trade"
buypots(amount)
end
Then in the walker you would do:
Node(x, y, z)
Node(x, y, z)
Action(buyPots(10))
Action(wait(1000,2000))
Node(x, y, z)
Raphael
02-04-2012, 04:50 PM
*Loling*
The scripting interface will remain as it is. While I MIGHT add the possibility to configure inline scripts into the walker, it will be very crude. Tibia's current textboxes don't support tabbed input or anything similar, and coding a box like that completely from scratch will be a highly tedious and time consuming job. If anything, for inline scripts, you're looking at something like the label box with a little more room. This means that any intensive inline-scripts would look like this:
setWalkerEnabled(false) if (var == value) then doAction(param1, param2, param3) else doAction(param1, param2, param3) end setWalkerEnabled(true)
Not only is it very uneasy on the eyes, but it also wouldn't even fully show itself inside the listbox, not to mention is less user-friendly (in my opinion) than the current system. Currently, you can create an entire depositor script in a single .LUA file. This fact is what leaves me unsure as to where people are obtaining their information since they all seem to believe otherwise.
The other problem that arises is that scripts execute in their own threads - once executed the walker would not wait for them to finish. While this can be a bit bitchy even with the current system, simultaneous processing would equate to a loss of functions such as wait()/sleep(). Furthermore, any processor expensive scripts would lag all of Tibia, since all of XenoBot's internal operations are executed on Tibia's main thread for data synchronism.
I understand many of you are complacent and will ultimately long for something like NeoBot until you learn something new. However, this is XenoBot. Yes, XenoBot has quite a few places where it falls short. It also, however, overtakes neobot in other aspects of its functionality. While few of those are currently visible, they will be soon. And the next person to call this bot unuserfriendly needs to go remind themselves how they had to set up combo attack in Neo. Hell, even the recasting of spells and such - talk about multiple LUA scripts.
TL;DR - You're already using a bot that's nearly able to do everything for you, stop bitching about having to set it up just one time to make that happen.
PS - That TL;DR was not at all a summary of what I said. If you care about a real informative post, actually read it, bro.
While it might make sense for the developer, the user has a much more harder task to run and set up the script, mainly because it separates things. It has 2 or more files to place on 2 different folders and load in 2 different ways to run 1 single script. Then if he wants, let's say, set up the scripts variables, he'd need to go to that .lua file again and open it using notepad, most people won't even understand it properly because .lua isn't a standard extension. Of course people will get used to it, in time, and I understand the bot limitations due to its design choice, but let's just not pretend it's better or perfect this way, only because it wouldn't be perfect the other way because of the bot limitations.
Another possibility could be adding a way to create a library of functions, then in the action waypoint you just input the function you want so for example:
I am too lazy to actually write a functional script so I am just going to summarize.
function buyPots(amount)
say "hi"
npcsay "trade"
buypots(amount)
end
Then in the walker you would do:
Node(x, y, z)
Node(x, y, z)
Action(buyPots(10))
Action(wait(1000,2000))
Node(x, y, z)
Well, then I can't really see the difference between naming the label as the name of the function or editing its content to simply call a function.
It loses the whole purpose and Syntax makes his point.
psychaos
02-04-2012, 04:52 PM
Another possibility could be adding a way to create a library of functions, then in the action waypoint you just input the function you want so for example:
I am too lazy to actually write a functional script so I am just going to summarize.
function buyPots(amount)
say "hi"
npcsay "trade"
buypots(amount)
end
Then in the walker you would do:
Node(x, y, z)
Node(x, y, z)
Action(buyPots(10))
Action(wait(1000,2000))
Node(x, y, z)
^ THIS!
DarkstaR, how about writing a user guide explaining how to actually create fully working scripts. it just seems to be 'work it out for yourself' at the moment.
sk8er08
02-04-2012, 09:35 PM
Well, then I can't really see the difference between naming the label as the name of the function or editing its content to simply call a function.
It loses the whole purpose and Syntax makes his point.
The difference is simplicity. Instead of opening 10 different script files and trying to reference them with labels all darkstar has to do is make a button labeled "Edit Functions" then it opens the text document, you edit it then CTRL + S and call the function you added in the walker. The idea is that when you create a function like that you can use it anywhere without having to rewrite the function each time for example checking cap, you can have multiple areas of your walker check your cap simply by putting Action(doCheckCap()) and doCheckCap() would be the function you created in functions.lua or w/e darkstar would name it by default.
Edit:
Or am I misunderstanding the walker label system? Does the walker label name correspond directly to the .lua filename already? (I haven't actually played around with the labels yet)
Raphael
02-04-2012, 09:37 PM
The difference is simplicity. Instead of opening 10 different script files and trying to reference them with labels all darkstar has to do is make a button labeled "Edit Functions" then it opens the text document, you edit it then CTRL + S and call the function you added in the walker. The idea is that when you create a function like that you can use it anywhere without having to rewrite the function each time for example checking cap, you can have multiple areas of your walker check your cap simply by putting Action(doCheckCap()) and doCheckCap() would be the function you created in functions.lua or w/e darkstar would name it by default.
You don't need 10 files, only one. The same file you'd need to write the functions itself.
Spectrus
02-04-2012, 09:54 PM
sk8er08
It's made, go read this: http://forums.xenobot.net/showthread.php?893-Alternative-Walker-Scripting-Format
sk8er08
02-04-2012, 11:15 PM
Well then... that is exactly what I meant! I must not have been crazy after all! Thanks a lot for that link, didn't think to look in that forum xD now if only the targeting was a bit more viable I may be able to take my eyes off my character long enough to watch a movie :D
Junnior
02-09-2012, 11:55 PM
I just have a question, what if someone makes a bad ass script like the perfect rune shooter sirmate made in neobot, would the seller have to give us the .lua file that goes with it or is there a way to encript it into the bot so no-one else uses it without permision? This might suck if we cant do that idk cuz people will use things like that if people start selling scripts which i am sure we will, idk if i explained myself xD but u get the poijt
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.