PDA

View Full Version : Inexperienced with LUA, trying to get this simple script to work?



Stonage07
06-13-2015, 03:47 PM
I've made this script by reading posts thru google, but I am at a complete dead stop, been at it for many hours and ive overcome some obstacles, but I cant get this script to work?

What am I doing wrong?

http://i.imgur.com/jA867aR.png



function onWalkerSelectLabel(labelName)

if (labelName == "GoLure") then
loadSettings("SeacrestsTRGT", "Targeting")
elseif (labelName == "DoneLure") then
loadSettings("SeacrestsEK", "Targeting")
end
end


Ty in advance

Ben
06-13-2015, 04:48 PM
Did you forget to put



registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")


before the function?

Stonage07
06-13-2015, 04:57 PM
Thx for the replies guys, it still wont load in the game, gives me this error message now

"18:55 XenoScript Error:
Script: Seacrests Lure.lua
Line #: 2
Chunk: C:?Users?PC?DOCUME?1?XenoBot?Scripts??SEACRE?3.LUA
Error: '=' expected near 'function'
This is an error with user-input and should not be reported as a bug with XenoBot.r"

registerEventListener
function onWalkerSelectLabel(labelName)

if (labelName == "GoLure") then
loadSettings("SeacrestsTRGT", "Targeting")
end

elseif (labelName == "DoneLure") then
loadSettings("SeacrestsEK", "Targeting")
end
end

Stonage07
06-13-2015, 04:58 PM
Im getting so hopeless, I started at 13:00, its 18:58 now, mannnn why is this so difficult

Stonage07
06-13-2015, 05:00 PM
A friend of mine added the script inside the config itself, and it seemed to work at fight, it went to other targetting settings. but once arrived at the kill spot it wouldnt re-enable to original KILL EVERYTHING targetting and just stand there like a idiot trying to rush through waypoints

This is the part i mean, and it does have eventlistener at the very start of thescript, its a copy n paste of Xtrmjosh's script

elseif (labelName == "GoLure") then
Targeting.Stop()
wait(200,500)
loadSettings("SeacrestsTRGT", "Targeting")
wait(200,500)
Targeting.Start()

elseif(label == "DoneLure") then
Walker.Stop()
Targeting.Stop()
wait(100,200)
loadSettings("SeacrestsEK", "Targeting")
Targeting.Start()
wait(200,500)
Walker.Start()

Stonage07
06-13-2015, 05:10 PM
Ah damn lol, my bad and jeez, what a mistake !!! Cant believe I overlooked that... Thanks for your help man, truly appreciate it

One general question, which of the two would you consider better? Is it required to stop the walker n' targetting for perfection? Or isnt it required

shadowart
06-13-2015, 05:15 PM
The walker automatically pauses when executing code at labels. You almost never need to explicitly stop the walker when dealing with labels. In this case you don't have to stop the targeter either. If you just want to ignore monsters while luring there is also a pair of functions called Targeting.StartIgnoring() and Targeting.StopIgnoring() that can be used instead of loading settings from a separate xbst.