PDA

View Full Version : Help me with Lua, errors.



Xparn
01-29-2013, 11:41 AM
I guess it's totally wrong but i want to know why it aint working :/
As long there is non tutorial how to make scripts with refiller... it should be easy to make for those who can make it... i will post my failures here trying to get help.




----------------------------------setting----------------------------------

manaId = 238
leaveMana = 50 --Number of mana potion you want to leave your hunt

SdID = 3155 -- SD ID
MinSds = 200 -- if less then script will exit spawn
SdCost = 108 -- cost of SD
Sds = 1000 -- amount to refill
----------------------------------------------------------------------------------------





registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)

if (labelName == "ToGoroma") then
setWalkerEnabled(false)
delayWalker(5000)
Self.SayToNpc({"hi","goroma","yes"}, 65)
sleep(math.random(500, 1000))
delayWalker(5000)
setWalkerEnabled(true)
end
end


registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)

if (labelName == "TravelLiberty") then
setWalkerEnabled(false)
delayWalker(5000)
Self.SayToNpc({"hi","Liberty bay","yes"}, 65)
sleep(math.random(500, 1000))
delayWalker(5000)
setWalkerEnabled(true)
end
end




registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)

if (labelName == "Checker") then
if ((Self.ItemCount(SdID) < MinSds)) or ((Self.ItemCount(SdID) < MinSds)) then
gotoLabel("Refill")
else
gotoLabel("KeepHunting")
end
end


registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
dofile("Forgee.lua")
function onWalkerSelectLabel(labelName)
if (labelName == "banker") then
setWalkerEnabled(false)
delayWalker(5000) --Call this immediately, before evr sleeping. Walker and scripter are in different threads so if we sleep before calling this walker will proceed a few wps before this bites
Self.Say("hi")
sleep(math.random(700, 1400)) --Sleep between everything we say. saying everything very quickly can be _highly_ suspicious
Self.SayToNpc("deposit all")
sleep(math.random(300, 1000))
Self.SayToNpc("yes")
sleep(math.random(300, 1000))
delayWalker(2000) --time in seconds*1000 you want the walker to delay
setWalkerEnabled(true)

elseif (labelName == "withdrawCash") then
setWalkerEnabled(false)
delayWalker(5000) --Call this immediately, before evr sleeping. Walker and scripter are in different threads so if we sleep before calling this walker will proceed a few wps before this bites
Self.Say("hi")
sleep(math.random(700, 1400)) --Sleep between everything we say. saying everything very quickly can be _highly_ suspicious
Self.WithdrawMoney((manaPrice*(maxMana-Self.ItemCount(manaId))))
sleep(math.random(800, 1500))
Self.SayToNpc("yes")
sleep(math.random(800, 1500))
Self.WithdrawMoney((healthPrice*(maxHealth-Self.ItemCount(healthId))))
sleep(math.random(800, 1500))
setWalkerEnabled(true)




elseif (labelName == "DepositItems") then
Self.DepositItems({8063,0}, {7436,0}, {8084,0}, {7454,0}, {3415,0}, {8044,0},{3052,0}, {7643,1}, {9667,1}, {10311,1}, {7642,1}, {236,1}, {10293,1}, {9055,1})






elseif (labelName == "FillUp") then
setWalkerEnabled(false)
delayWalker(7000) --Call this immediately, before evr sleeping. Walker and scripter are in different threads so if we sleep before calling this walker will proceed a few wps before this bites
Self.Say("hi")
sleep(math.random(800, 1700)) --Sleep between everything we say. saying everything very quickly can be _highly_ suspicious
Self.SayToNpc("trade")
sleep(math.random(2000, 2400)) --Sleep between everything we say. saying everything very quickly can be _highly_ suspicious
Self.ShopBuyItem(SdID, (MinSD-Self.ItemCount(SdID)))
sleep(math.random(800, 1700))
setWalkerEnabled(true)


elseif (labelName == "CheckPos") then
delayWalker(2000)
if(pos.x == 32346 and pos.y == 32810 and pos.z == 7) then
gotoLabel("go1")
setTargetingEnabled(true)
else
gotoLabel("Refill")

elseif (labelName == "GoToHunt") then
delayWalker(2000)
gotoLabel("KeepHunting")




if (labelName == "followNPC") then
local creature = "Jack Fate"
creature:Follow()
end
end

Spectrus
01-29-2013, 11:47 AM
To start, the way you're doing this is all wrong. Here is the general format for the label event.



registerEventListener(WALKER_SELECTLABEL, "onLabel")

function onLabel(labelName)
if (labelName == "Label1") then
-- Execute code for Label1
elseif (labelName == "Label2") then
-- Execute code for Label2
end
end


Fix that and repost your code, and we'll take it from there.

Xparn
01-29-2013, 12:11 PM
To start, the way you're doing this is all wrong. Here is the general format for the label event.



registerEventListener(WALKER_SELECTLABEL, "onLabel")

function onLabel(labelName)
if (labelName == "Label1") then
-- Execute code for Label1
elseif (labelName == "Label2") then
-- Execute code for Label2
end
end


Fix that and repost your code, and we'll take it from there.



----------------------------------setting----------------------------------

manaId = 238
leaveMana = 50 --Number of mana potion you want to leave your hunt

SdID = 3155 -- SD ID
MinSds = 200 -- if less then script will exit spawn
SdCost = 108 -- cost of SD
Sds = 1000 -- amount to refill
----------------------------------------------------------------------------------------




registerEventListener(WALKER_SELECTLABEL, "onLabel")

function onLabel(labelName)
if (labelName == "ToGoroma") then
setWalkerEnabled(false)
delayWalker(5000)
Self.SayToNpc({"hi","goroma","yes"}, 65)
sleep(math.random(500, 1000))
delayWalker(5000)
setWalkerEnabled(true)
end
end


registerEventListener(WALKER_SELECTLABEL, "onLabel")
function onLabel(labelName)

if (labelName == "TravelLiberty") then
setWalkerEnabled(false)
delayWalker(5000)
Self.SayToNpc({"hi","Liberty bay","yes"}, 65)
sleep(math.random(500, 1000))
delayWalker(5000)
setWalkerEnabled(true)
end
end




registerEventListener(WALKER_SELECTLABEL, "onLabel")
function onLabel(labelName)

if (labelName == "Checker") then
if ((Self.ItemCount(SdID) < MinSds)) or ((Self.ItemCount(SdID) < MinSds)) then
gotoLabel("Refill")
else
gotoLabel("KeepHunting")
end
end


registerEventListener(WALKER_SELECTLABEL, "onLabel")
dofile("Forgee.lua")
function onLabel(labelName)
if (labelName == "banker") then
setWalkerEnabled(false)
delayWalker(5000) --Call this immediately, before evr sleeping. Walker and scripter are in different threads so if we sleep before calling this walker will proceed a few wps before this bites
Self.Say("hi")
sleep(math.random(700, 1400)) --Sleep between everything we say. saying everything very quickly can be _highly_ suspicious
Self.SayToNpc("deposit all")
sleep(math.random(300, 1000))
Self.SayToNpc("yes")
sleep(math.random(300, 1000))
delayWalker(2000) --time in seconds*1000 you want the walker to delay
setWalkerEnabled(true)

elseif (labelName == "withdrawCash") then
setWalkerEnabled(false)
delayWalker(5000) --Call this immediately, before evr sleeping. Walker and scripter are in different threads so if we sleep before calling this walker will proceed a few wps before this bites
Self.Say("hi")
sleep(math.random(700, 1400)) --Sleep between everything we say. saying everything very quickly can be _highly_ suspicious
Self.WithdrawMoney((manaPrice*(maxMana-Self.ItemCount(manaId))))
sleep(math.random(800, 1500))
Self.SayToNpc("yes")
sleep(math.random(800, 1500))
Self.WithdrawMoney((healthPrice*(maxHealth-Self.ItemCount(healthId))))
sleep(math.random(800, 1500))
setWalkerEnabled(true)




elseif (labelName == "DepositItems") then
Self.DepositItems({8063,0}, {7436,0}, {8084,0}, {7454,0}, {3415,0}, {8044,0},{3052,0}, {7643,1}, {9667,1}, {10311,1}, {7642,1}, {236,1}, {10293,1}, {9055,1})






elseif (labelName == "FillUp") then
setWalkerEnabled(false)
delayWalker(7000) --Call this immediately, before evr sleeping. Walker and scripter are in different threads so if we sleep before calling this walker will proceed a few wps before this bites
Self.Say("hi")
sleep(math.random(800, 1700)) --Sleep between everything we say. saying everything very quickly can be _highly_ suspicious
Self.SayToNpc("trade")
sleep(math.random(2000, 2400)) --Sleep between everything we say. saying everything very quickly can be _highly_ suspicious
Self.ShopBuyItem(SdID, (MinSD-Self.ItemCount(SdID)))
sleep(math.random(800, 1700))
setWalkerEnabled(true)


elseif (labelName == "CheckPos") then
delayWalker(2000)
if(pos.x == 32346 and pos.y == 32810 and pos.z == 7) then
gotoLabel("go1")
setTargetingEnabled(true)
else
gotoLabel("Refill")

elseif (labelName == "GoToHunt") then
delayWalker(2000)
gotoLabel("KeepHunting")




if (labelName == "followNPC") then
local creature = "Jack Fate"
creature:Follow()
end
end

Xparn
01-29-2013, 02:23 PM
Only fixed the layout.
Didn't check if any coding was wrong.



----------------------------------setting----------------------------------

manaId = 238
leaveMana = 50 --Number of mana potion you want to leave your hunt
SdID = 3155 -- SD ID
MinSds = 200 -- if less then script will exit spawn
SdCost = 108 -- cost of SD
Sds = 1000 -- amount to refill
----------------------------------------------------------------------------------------


dofile("Forgee.lua")

registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "ToGoroma") then
setWalkerEnabled(false)
delayWalker(5000)
Self.SayToNpc({"hi","goroma","yes"}, 65)
sleep(math.random(500, 1000))
delayWalker(5000)
setWalkerEnabled(true)
elseif (labelName == "TravelLiberty") then
setWalkerEnabled(false)
delayWalker(5000)
Self.SayToNpc({"hi","Liberty bay","yes"}, 65)
sleep(math.random(500, 1000))
delayWalker(5000)
setWalkerEnabled(true)
elseif (labelName == "Checker") then
if ((Self.ItemCount(SdID) < MinSds) or (Self.ItemCount(SdID) < MinSds)) then
gotoLabel("Refill")
else
gotoLabel("KeepHunting")
end
elseif (labelName == "banker") then
setWalkerEnabled(false)
delayWalker(5000) --Call this immediately, before evr sleeping. Walker and scripter are in different threads so if we sleep before calling this walker will proceed a few wps before this bites
Self.Say("hi")
sleep(math.random(700, 1400)) --Sleep between everything we say. saying everything very quickly can be _highly_ suspicious
Self.SayToNpc("deposit all")
sleep(math.random(300, 1000))
Self.SayToNpc("yes")
sleep(math.random(300, 1000))
delayWalker(2000) --time in seconds*1000 you want the walker to delay
setWalkerEnabled(true)
elseif (labelName == "withdrawCash") then
setWalkerEnabled(false)
delayWalker(5000) --Call this immediately, before evr sleeping. Walker and scripter are in different threads so if we sleep before calling this walker will proceed a few wps before this bites
Self.Say("hi")
sleep(math.random(700, 1400)) --Sleep between everything we say. saying everything very quickly can be _highly_ suspicious
Self.WithdrawMoney((manaPrice*(maxMana-Self.ItemCount(manaId))))
sleep(math.random(800, 1500))
Self.SayToNpc("yes")
sleep(math.random(800, 1500))
Self.WithdrawMoney((healthPrice*(maxHealth-Self.ItemCount(healthId))))
sleep(math.random(800, 1500))
setWalkerEnabled(true)
elseif (labelName == "DepositItems") then
Self.DepositItems({8063,0}, {7436,0}, {8084,0}, {7454,0}, {3415,0}, {8044,0},{3052,0}, {7643,1}, {9667,1}, {10311,1}, {7642,1}, {236,1}, {10293,1}, {9055,1})
elseif (labelName == "FillUp") then
setWalkerEnabled(false)
delayWalker(7000) --Call this immediately, before evr sleeping. Walker and scripter are in different threads so if we sleep before calling this walker will proceed a few wps before this bites
Self.Say("hi")
sleep(math.random(800, 1700)) --Sleep between everything we say. saying everything very quickly can be _highly_ suspicious
Self.SayToNpc("trade")
sleep(math.random(2000, 2400)) --Sleep between everything we say. saying everything very quickly can be _highly_ suspicious
Self.ShopBuyItem(SdID, (MinSD-Self.ItemCount(SdID)))
sleep(math.random(800, 1700))
setWalkerEnabled(true)
elseif (labelName == "CheckPos") then
delayWalker(2000)
if (pos.x == 32346 and pos.y == 32810 and pos.z == 7) then
gotoLabel("go1")
setTargetingEnabled(true)
else
gotoLabel("Refill")
end
elseif (labelName == "GoToHunt") then
delayWalker(2000)
gotoLabel("KeepHunting")
elseif (labelName == "followNPC") then
local creature = "Jack Fate"
creature:Follow()
end
end
end


It doesn't work

15:21 XenoScript Error:
Script: Goroma1SDTEST.lua
Line #: 87
Chunk: C:?Users?flbnm?Documents?XenoBot?Scripts?Goroma1SD TEST.lua
Error: '<eof>' expected near 'end'
This is an error with user-input and should not be reported as a bug with XenoBot.


Help please.

Xparn
01-29-2013, 06:53 PM
Oh, sorry. My mistake.
Try this one:



----------------------------------setting----------------------------------

manaId = 238
leaveMana = 50 --Number of mana potion you want to leave your hunt
SdID = 3155 -- SD ID
MinSds = 200 -- if less then script will exit spawn
SdCost = 108 -- cost of SD
Sds = 1000 -- amount to refill
----------------------------------------------------------------------------------------


dofile("Forgee.lua")

registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "ToGoroma") then
setWalkerEnabled(false)
delayWalker(5000)
Self.SayToNpc({"hi","goroma","yes"}, 65)
sleep(math.random(500, 1000))
delayWalker(5000)
setWalkerEnabled(true)
elseif (labelName == "TravelLiberty") then
setWalkerEnabled(false)
delayWalker(5000)
Self.SayToNpc({"hi","Liberty bay","yes"}, 65)
sleep(math.random(500, 1000))
delayWalker(5000)
setWalkerEnabled(true)
elseif (labelName == "Checker") then
if ((Self.ItemCount(SdID) < MinSds) or (Self.ItemCount(SdID) < MinSds)) then
gotoLabel("Refill")
else
gotoLabel("KeepHunting")
end
elseif (labelName == "banker") then
setWalkerEnabled(false)
delayWalker(5000) --Call this immediately, before evr sleeping. Walker and scripter are in different threads so if we sleep before calling this walker will proceed a few wps before this bites
Self.Say("hi")
sleep(math.random(700, 1400)) --Sleep between everything we say. saying everything very quickly can be _highly_ suspicious
Self.SayToNpc("deposit all")
sleep(math.random(300, 1000))
Self.SayToNpc("yes")
sleep(math.random(300, 1000))
delayWalker(2000) --time in seconds*1000 you want the walker to delay
setWalkerEnabled(true)
elseif (labelName == "withdrawCash") then
setWalkerEnabled(false)
delayWalker(5000) --Call this immediately, before evr sleeping. Walker and scripter are in different threads so if we sleep before calling this walker will proceed a few wps before this bites
Self.Say("hi")
sleep(math.random(700, 1400)) --Sleep between everything we say. saying everything very quickly can be _highly_ suspicious
Self.WithdrawMoney((manaPrice*(maxMana-Self.ItemCount(manaId))))
sleep(math.random(800, 1500))
Self.SayToNpc("yes")
sleep(math.random(800, 1500))
Self.WithdrawMoney((healthPrice*(maxHealth-Self.ItemCount(healthId))))
sleep(math.random(800, 1500))
setWalkerEnabled(true)
elseif (labelName == "DepositItems") then
Self.DepositItems({8063,0}, {7436,0}, {8084,0}, {7454,0}, {3415,0}, {8044,0},{3052,0}, {7643,1}, {9667,1}, {10311,1}, {7642,1}, {236,1}, {10293,1}, {9055,1})
elseif (labelName == "FillUp") then
setWalkerEnabled(false)
delayWalker(7000) --Call this immediately, before evr sleeping. Walker and scripter are in different threads so if we sleep before calling this walker will proceed a few wps before this bites
Self.Say("hi")
sleep(math.random(800, 1700)) --Sleep between everything we say. saying everything very quickly can be _highly_ suspicious
Self.SayToNpc("trade")
sleep(math.random(2000, 2400)) --Sleep between everything we say. saying everything very quickly can be _highly_ suspicious
Self.ShopBuyItem(SdID, (MinSD-Self.ItemCount(SdID)))
sleep(math.random(800, 1700))
setWalkerEnabled(true)
elseif (labelName == "CheckPos") then
delayWalker(2000)
if (pos.x == 32346 and pos.y == 32810 and pos.z == 7) then
gotoLabel("go1")
setTargetingEnabled(true)
else
gotoLabel("Refill")
end
elseif (labelName == "GoToHunt") then
delayWalker(2000)
gotoLabel("KeepHunting")
elseif (labelName == "followNPC") then
local creature = "Jack Fate"
creature:Follow()
end
end


Thanks it worked though i get still problem,


19:52 XenoScript Error:
Script: [One-Liner executed by XenoBot Walker]
Line #: 1
Chunk: [string "Wait(600, 700)"]
Error: attempt to call global 'Wait' (a nil value)
This is an error with user-input and should not be reported as a bug with XenoBot.
19:52 XenoScript Error:
Script: [One-Liner executed by XenoBot Walker]
Line #: 1
Chunk: [string "Wait(600, 700)"]
Error: attempt to call global 'Wait' (a nil value)
This is an error with user-input and should not be reported as a bug with XenoBot.

I fixed that one, the wait was Wait that why it errored, though i can't it to follow the npc still.... and after it travelled to liberty bay it doesn't deposit items nor withdrawing money and when it trying to buy runes i get this




19:55 XenoScript Error:
Script: Goroma1SDTEST.lua
Line #: 68
Chunk: ...fblb?Documents?XenoBot?Scripts?Goroma1SDTEST.lu a
Error: attempt to perform arithmetic on global 'MinSD' (a nil value)
This is an error with user-input and should not be reported as a bug with XenoBot.

Xparn
01-29-2013, 08:41 PM
Change:

Self.ShopBuyItem(SdID, (MinSD-Self.ItemCount(SdID)))

To:

Self.ShopBuyItem(SdID, (Sds-Self.ItemCount(SdID)))

Thanks it worked however, it only buys 100... i wanted it to buy about 1000 and, when it's checking the pos if im on the right place i get this error:


21:39 XenoScript Error:
Script: Goroma1SDTEST.lua
Line #: 73
Chunk: ...flbflb?Documents?XenoBot?Scripts?Goroma1SDTEST. lua
Error: attempt to index global 'pos' (a nil value)
This is an error with user-input and should not be reported as a bug with XenoBot.

DarkstaR
01-29-2013, 09:05 PM
Didn't look at the code, but n extrapolation from your thread title suggests you may have a misplaced comma.

Xparn
01-29-2013, 09:12 PM
Didn't look at the code, but n extrapolation from your thread title suggests you may have a misplaced comma.

yeah, funny now take your time and help me out?

DarkstaR
01-29-2013, 09:48 PM
I wont help fix scripts that are deprecated. Get rid of Forgee and use proper functions. Also, learn to understand error codes. Also, don't bitch at my post which is telling you to learn something. It will save you much time in the future.

Xparn
01-29-2013, 09:52 PM
I wont help fix scripts that are deprecated. Get rid of Forgee and use proper functions. Also, learn to understand error codes. Also, don't bitch at my post which is telling you to learn something. It will save you much time in the future.

As i said earlier in my posts, this is what you get when you asks for help... You expect people to use your bot when you aren't helping at all, not a single tutorial how you make refillers and this is what you get when you trying by your own, and don't understands what's wrong.

Hopefully you grow up, in a day.

DarkstaR
01-29-2013, 09:57 PM
As i said earlier in my posts, this is what you get when you asks for help... You expect people to use your bot when you aren't helping at all, not a single tutorial how you make refillers and this is what you get when you trying by your own, and don't understands what's wrong.

Hopefully you grow up, in a day.

Not hardly.

If you come here looking to learn and improve, I help you ("Hey, I have this error, what does it mean?"). If all you do is post an error code and say "fix it," I dismiss you as a lazy narcissistic idiot. We aren't your slaves. You paid for a bot, not for free development. We are kind enough to post tutorials (yes, there are tutorials) and example scripts (we have those, too). Also, every single time I make additions or changes to the Lua system, I provide example lua code and in-depth explanations for the new features or changes. Everysinglefunction in the Scripter has example code, written by me personally, in the release threads.

When you take that into account, it just makes you look lazy, now doesn't it?

Xparn
01-29-2013, 10:29 PM
Not hardly.

If you come here looking to learn and improve, I help you ("Hey, I have this error, what does it mean?"). If all you do is post an error code and say "fix it," I dismiss you as a lazy narcissistic idiot. We aren't your slaves. You paid for a bot, not for free development. We are kind enough to post tutorials (yes, there are tutorials) and example scripts (we have those, too). Also, every single time I make additions or changes to the Lua system, I provide example lua code and in-depth explanations for the new features or changes. Everysinglefunction in the Scripter has example code, written by me personally, in the release threads.

When you take that into account, it just makes you look lazy, now doesn't it?

That i even respond, a mod calling other Narcisstic idiot's ... seems serious business here.

Yes i paid for a bot, knowing there is a forum where you can get help for just this, the bot main function is to make the game easier... You however ain't supporting the people who actually giving you money for this. Do you expect people to actually learn Lua programming? If you expect that, then whoever goes learn programming will in the end making their own bot if that was the case... but guess it's not.

Saying people are lazy and idiot's because they asking for help, i mean who are you kidding get your self straight before responding as a owner of this program that you are selling.


'Hey i sell you this bot, however you need to learn programming if you want it to work'

Tibtrak
01-29-2013, 11:07 PM
That i even respond, a mod calling other Narcisstic idiot's ... seems serious business here.

Yes i paid for a bot, knowing there is a forum where you can get help for just this, the bot main function is to make the game easier... You however ain't supporting the people who actually giving you money for this. Do you expect people to actually learn Lua programming? If you expect that, then whoever goes learn programming will in the end making their own bot if that was the case... but guess it's not.

Saying people are lazy and idiot's because they asking for help, i mean who are you kidding get your self straight before responding as a owner of this program that you are selling.


'Hey i sell you this bot, however you need to learn programming if you want it to work'

Seriously? I know nothing about programming and close to nothing when it comes to .lua scripting. I still manage to make fully afk scripts for all my chars, just because DarkstaR has made an awsome job making great features and as he said, he has explained each new feature and added examples to every code, making it pretty easy to put things togheter. It is also tutorials in this forum, if you look at them, download a few scripts and see how they are made, then you shouldn't have much problem making simple scripts yourself either. DS is also helping alot of ppl here that are asking for his help, and if he doesn't, he has moderators doing a great job helping ppl out too. You've just recieved help from 2 moderators that knows what they are talking about, and you've also gotten help from DarkstaR, I cannot see how you manage to claim that the support in this forum is bad, cuz it isn't, not at all. People tend to be very helpfull here, atleast thats my experience. If you just make a tiny bit of an effort yourself sometimes too, not just asking ppl to do everything for you the moment you have a problem, but do a little research yourself first, then you might actually learn something and eventually "make the bot work".

This is what Im talking about:

You expect people to use your bot when you aren't helping at all, not a single tutorial how you make refillers

No tutorial to make refillers? Maybe its not made a thread called "This is a tutorial for refilling", but if you use the magic searchbutton, you'll easily find scripts to deposit items in dp, withdraw items from dp, withdraw/deposit cash from/to bank, buy pots/bolts etc, you'll find bp-resetters, and there you go, you have a tutorial for refilling, its all in this forum. And it's all easy to find. It is also explanations how to use them.

Xparn
01-29-2013, 11:33 PM
Seriously? I know nothing about programming and close to nothing when it comes to .lua scripting. I still manage to make fully afk scripts for all my chars, just because DarkstaR has made an awsome job making great features and as he said, he has explained each new feature and added examples to every code, making it pretty easy to put things togheter. It is also tutorials in this forum, if you look at them, download few scripts and see how they are made, then you shouldn't have much problem making simple scripts yourself. DS is also helping alot of ppl here that are asking for his help, and if he doesn't, he has moderators doing a great job helping ppl out too. You've just recieved help from 2 moderators that knows what they are talking about, and you've also gotten help from DarkstaR, I cannot see how you manage to claim that the support in this forum is bad, cuz it isn't, not at all. People tend to be very helpfull here, atleast thats my experience. If you just make a tiny bit of an effort yourself sometimes too, not just asking ppl to do everything for you the moment you have a problem, but do a little research yourself first, then you might actually learn something and eventually "make the bot work".

This is what Im talking about:


No tutorial to make refillers? Maybe its not made a thread called "This is a tutorial for refilling", but if you use the magic searchbutton, you'll easily find scripts to deposit items in dp, withdraw items from dp, buy pots/bolts etc, you'll find bp-resetters, its all in this forum. And it's all easy to find. And it's also explanations how to use them.

It's funny how you trying to say that you doesn't know almost nothing when it comes to .lua scripting, when you can make your own 100% afk scripts.
If you learned by yourself and "putted it" toghether, please show me where to begin. Because i've posted already 2 times on this forum re-made scripts orignally made by others and tried to understand what to do and what to change.
When you are telling me that i got some help of darkstar, can you refer what you mean by help?

Anyway as you can see for those who helped i thanked them and i continue to trying to get help, when i get help in the end i learn.
And have you even tried the search button? It's useless it only takes the first word so you can't really search "This is a tutorial for refilling" And if there is please, please! do show one... Only that i've found is already made scripts that doesn't teach you how to make your own refiller script at all. I found a step tutorial in google on a other site though... sadly it's outdated.
When you telling me to put some effort in it myself, what do you think i have when i have sent my waypoints 1 on a other thread then i had to rework the whole script using some other borrowed codes from others scripts including them to one and removing and editing and so on, then posting here trying to get help and asking what i've done wrong... What more can i do? I have searched the forum i have looked in other scripts.. What more can i do? If not asking. I never imagined questions and asking help would be a issue, and even be called an idiot and narcissit by an MOD. Just totally out from the blue.

Those scripts you reffering to where the code makes that and that... i Already have some of those codes in my script... but does it work? No. So it's not just that simply so then i come here, and this is what you get.

If you guys actually find it so easy and you can find the help you would need if you was a beginner please enlighten me, or atleast help instead of arguing about what do exist and what doesn't.

You can't build a house without knowledge and help...

ADD; haha i even searched on "This is a tutorial for refilling" it's funny to see what i got.

Tibtrak
01-30-2013, 12:04 AM
It's funny how you trying to say that you doesn't know almost nothing when it comes to .lua scripting, when you can make your own 100% afk scripts.
If you learned by yourself and "putted it" toghether, please show me where to begin. Because i've posted already 2 times on this forum re-made scripts orignally made by others and tried to understand what to do and what to change.
When you are telling me that i got some help of darkstar, can you refer what you mean by help?

Anyway as you can see for those who helped i thanked them and i continue to trying to get help, when i get help in the end i learn.
And have you even tried the search button? It's useless it only takes the first word so you can't really search "This is a tutorial for refilling" And if there is please, please! do show one... Only that i've found is already made scripts that doesn't teach you how to make your own refiller script at all. I found a step tutorial in google on a other site though... sadly it's outdated.
When you telling me to put some effort in it myself, what do you think i have when i have sent my waypoints 1 on a other thread then i had to rework the whole script using some other borrowed codes from others scripts including them to one and removing and editing and so on, then posting here trying to get help and asking what i've done wrong... What more can i do? I have searched the forum i have looked in other scripts.. What more can i do? If not asking. I never imagined questions and asking help would be a issue, and even be called an idiot and narcissit by an MOD. Just totally out from the blue.

Those scripts you reffering to where the code makes that and that... i Already have some of those codes in my script... but does it work? No. So it's not just that simply so then i come here, and this is what you get.

If you guys actually find it so easy and you can find the help you would need if you was a beginner please enlighten me, or atleast help instead of arguing about what do exist and what doesn't.

You can't build a house without knowledge and help...

ADD; haha i even searched on "This is a tutorial for refilling" it's funny to see what i got.

1. When I say that I almost dont know anything about .lua scripting it is because i find it hard to write every code and function myself from scratch. Like I wanted a function to move manas from main bp to x bp after buying manas in shop, to write that by myself I find hard. The people really knowing this shit, can write without too much trouble. Luckily I dont need to know how to write all functions from scratch, cuz most functions are already written for me and can be found in this forum. All I have to do is copy/paste the function into notpad and set the script up correctly by tabbing it right etc. And there is many examples on how to do that. So making 100% afk script doent mean you really have to know .lua, thats my point, you just have to be able to put togheter already made functions by the people that actually know .lua. And thats why I said you'll be able to make simple scripts, because if you're making more advanced scripts then it might be needed to know a little more.

2. I consider this helping.

Didn't look at the code, but n extrapolation from your thread title suggests you may have a misplaced comma.

3. Great that you've thanked the people helping you :)

4. Yes, I've tried the search button, and I find it very usefull.
Here i just tried it:
Reset-Bps: http://forums.xenobot.net/showthread.php?10210-Best-way-to-reset-backpack&p=119881&viewfull=1#post119881
Deposit/Withdraw from dp + Deposit/withdraw cash at bank http://forums.xenobot.net/showthread.php?5171-Simple-and-useful-LUA&highlight=deposit

5. I told you there wont be any thread called "This is a tutorial for refilling", you just have to search for every single function you would use when refilling. (I named them in my last post.)

6. If you've really given it an effort I'm sorry for claming something else...

7. Narcissist and idiot wasn't totally out of the blue. I mean, you had just asked him when he would grow up, I'd say he just "went down to your level." And if you've seen DS posts before it shouldn't be too much of a surprice either. Don't get too offended :)

8. If you learn how to put all the codes togheter its quite easy. Maybe thats what you find hard. Thats why I said you should download a few scripts and see how its done. There are bad scripts in this forum too which wont help you much, so try finding some good scripters that has released free scripts. Like you can see if any of the guys selling scripts has released some free ones too.

9. I don't have time now, but maybe I can help you out tomorrow if you contact me :)

Xparn
01-30-2013, 12:21 AM
1. When I say that I almost dont know anything about .lua scripting it is because i find it hard to write every code and function myself from scratch. Like I wanted a function to move manas from main bp to x bp after buying manas in shop, to write that by myself I find hard. The people really knowing this shit, can write without too much trouble. Luckily I dont need to know how to write all functions from scratch, cuz most functions are already written for me and can be found in this forum. All I have to do is copy/paste the function into notpad and set the script up correctly by tabbing it right etc. And there is many examples on how to do that. So making 100% afk script doent mean you really have to know .lua, thats my point, you just have to be able to put togheter already made functions by the people that actually know .lua. And thats why I said you'll be able to make simple scripts, because if you're making more advanced scripts then it might be needed to know a little more.

2. I consider this helping.


3. Great that you've thanked the people helping you :)

4. Yes, I've tried the search button, and I find it very usefull.

5. I told you there wont be any thread called "This is a tutorial for refilling", you just have to search for every single function you would use when refilling. (I named them in my last post.)

6. If you've really given it an effort I'm sorry for claming something else...

7. Narcissist and idiot wasn't totally out of the blue, I mean you had just asked him when he would grow up, I mean he just went down to your level.

8. If you learn how to put all the codes togheter its quite easy. Maybe thats what you find hard. Thats why I said you should download a few scripts and see how its done. There are bad scripts in this forum too which wont help you much, so try finding some good scripters that has released free scripts. Like you can see if any of the guys selling scripts has released some free ones too.

9. I don't have time now, but maybe I can help you out tomorrow if you contact me :)

1, that's exactly what i've tried to do but can't get it to work then i ask here so i can see what's wrong... for an example i got help with some things and i learned from that from this thread, but i do still have problems but as i get help it's getting better... so if i had some more help i would make it and probably learn of it then after maybe i don't have to ask questions like these.
2, if it's informative then yes it is.
3, Just that should somehow remove the "narcisist" from the "Hey let's flame you with this" -list.
4, Maybe... but i can't find it useful when i can't find a tutorial of how you make refiller and everyone else says it's so easy... I use google -> xenobot + Searchword to find the best results.. however i cant still find any refiller guide/tutorial.
5, sure i can find some code but i don't know where to put it if i make my own, nothing of that stands... not even if you wanted some other runes or potions.
6, As you said sorry, i'm grateful... because some people can't say that when they just did something wrong.
7, Nevermind, guess he tok it to hard.. though my words didn't come out from the blue :)
8, That what i thought but to do that i need to have some more help.
9, sure i'll wait for you.. thanks.

Tibtrak
01-30-2013, 11:26 PM
okey, so I tried helping Xparn with his problems. But there was one thing I found very strange. This function did not work for him. It works if I use the exact same code for my chars with my bot....



ManasToBuy = 200
ManaPotsID = 238
ManaPotsPrice = 120

SDsToBuy = 1000
SDID = 3155
SDPrice = 108

elseif (labelName == "WithdrawCash") then
Walker.Stop()
Self.SayToNpc('hi')
wait(1000,2000)
local GoldToManas = ((ManasToBuy-Self.ItemCount(ManaPotsID))*ManaPotsPrice)
local GoldToRunes = ((SDsToBuy-Self.ItemCount(SDID))*SDPrice)
local GoldToSofts = (Self.ItemCount(6530)*10000)
local GoldToMP = math.ceil(GoldToManas / 1000) * 1000
local GoldToSD = math.ceil(GoldToRunes / 1000) * 1000
Self.SayToNpc("withdraw " .. GoldToMP + GoldToSD + 500)
wait(1000,2000)
Self.SayToNpc('yes')
wait(1000,2000)
Walker.Start()


This one SHOULD work, but when Xparn is trying it, the NPC tells him he doesnt have enough money. But he does. He has several kk's. So it shouldn't be a problem.

Anyway, when this didn't work. I even tried to do this more simple one:


Self.SayToNpc({"hi", "withdraw", "40000", "yes"}, 65)


He still got the message that he didnt have enough cash. Thats making me really confused. What can be wrong making it want to withdraw that much cash?. (yes again, he HAS enough cash)

Anyone with ideas?

Rydan, Spectrus, Infernal Bolt (sorry for mentioning, but this was all too wierd for me)

Xparn
01-30-2013, 11:59 PM
However it works when i make
Self.SayToNpc({"hi", "withdraw 40000", "yes"}, 65)

but the 2 he mentioned above doesn't work...

EDIT; I tried to edit and do things...

I got this to work


----------------------------------setting----------------------------------
ManaId = 238
MaxMana = 200
ManaPrice = 120
MinSds = 200
SDsToBuy = 1000
SdID = 3155
SDPrice = 108
----------------------------------------------------------------------------------------


elseif (labelName == "WithdrawMoney") then
Walker.Stop()
Self.SayToNpc('hi')
Self.WithdrawMoney((ManaPrice*(MaxMana-Self.ItemCount(ManaId))))
wait(900, 1200)
Self.SayToNpc("yes")
wait(900, 1200)
Self.WithdrawMoney((SDPrice*(SDsToBuy-Self.ItemCount(SdID))))
wait(900, 1200)
Self.SayToNpc("yes")
wait(900, 1200)
Self.SayToNpc("withdraw 500")
wait(900, 1200)
Self.SayToNpc("yes")
wait(2000,4000)
setWalkerEnabled(true)
wait(2000)


However it does only take out for the SDS not the GMPS.


EDIT; FOUND A SOLUTION AND A BUG!
I NOTICED A BUG, YOU NEED TO BE ABLE TO DEPOSIT SOME CASH BEFORE YOU WITHDRAW OR IT WILL BUG THE FIRST LINE OF CODE (THE WITHDRAW MONEY) AND THE SECOND LINE WILL WORK..

YOU JUST NEED TO HAVE 1 GP ON YOU TO DEPOSIT AND IT WILL WORK.

Petit Ours
01-31-2013, 03:13 AM
Dude i am not realy proud of you ...
I create a whole tutorial about getting start with xenobot basic thing:

-Depot
-potion
-bank
-and more

and you are still complaining about there is no instruction? !!!

You will be able to code your own script after few hour of work because you need to understand tibia and lua.

Learn how a basic lua script work by looking at this banker:


--~~~~~~~~~~Setting~~~~~~~~~~~~~~~~
manaId = 238
manaMax = 200
manaPrice = 120
manaLeave = 20

sdId = 3155
sdMax = 1000
sdPrice = 108
sdLeave = 200

money = (manaPrice*(manaMax-Self.ItemCount(manaId)))+(sdPrice*(sdMax-Self.ItemCount(sdId)))
--~~~~~~~~end of setting~~~~~~~~~

registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)

if(labelName == "bank") then
Walker.Stop()
Self.SayToNpc({"hi","deposit all","yes","balance"}, 65)
Walker.Delay(5000)
if(money == 0) then
Self.SayToNpc("bye")
elseif(money>0 and money<10000) then
Self.SayToNpc({"withdraw 10000", "yes"}, 65)
elseif(money>=10000 and money<20000) then
Self.SayToNpc({"withdraw 20000", "yes"}, 65)
elseif(money>=20000 and money<50000) then
Self.SayToNpc({"withdraw 50000", "yes"}, 65)
end

elseif(labelName == "potion") then

--[instruction for potion here]

end
end


Understand the code and ask good question if you dont know what it make.

You also need to understand the patterns: if you open a if somewhere you need to close it at the end.

Keep going bro we all learn somewhere but please, respect other person that want to help you.

Petit Ours :D

Xparn
01-31-2013, 03:33 AM
Dude i am not realy proud of you ...
I create a whole tutorial about getting start with xenobot basic thing:

-Depot
-potion
-bank
-and more

and you are still complaining about there is no instruction? !!!

You will be able to code your own script after few hour of work because you need to understand tibia and lua.

Learn how a basic lua script work by looking at this banker:


--~~~~~~~~~~Setting~~~~~~~~~~~~~~~~
manaId = 238
manaMax = 200
manaPrice = 120
manaLeave = 20

sdId = 3155
sdMax = 1000
sdPrice = 108
sdLeave = 200

money = (manaPrice*(manaMax-Self.ItemCount(manaId)))+(sdPrice*(sdMax-Self.ItemCount(sdId)))
--~~~~~~~~end of setting~~~~~~~~~

registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)

if(labelName == "bank") then
Walker.Stop()
Self.SayToNpc({"hi","deposit all","yes","balance"}, 65)
Walker.Delay(5000)
if(money == 0) then
Self.SayToNpc("bye")
elseif(money>0 and money<10000) then
Self.SayToNpc({"withdraw 10000", "yes"}, 65)
elseif(money>=10000 and money<20000) then
Self.SayToNpc({"withdraw 20000", "yes"}, 65)
elseif(money>=20000 and money<50000) then
Self.SayToNpc({"withdraw 50000", "yes"}, 65)
end

elseif(labelName == "potion") then

--[instruction for potion here]

end
end


Understand the code and ask good question if you dont know what it make.

You also need to understand the patterns: if you open a if somewhere you need to close it at the end.

Keep going bro we all learn somewhere but please, respect other person that want to help you.

Petit Ours :D

I already got it to work, altough i have some problems left... etc Creature.Follow("Jack Fate") Doesn't work... please check this thread ->
http://forums.xenobot.net/showthread.php?10677-Creature.Follow%28-NPCNAME-%29/page2

Infernal Bolt
01-31-2013, 08:22 AM
You seem to have problems with everything, reinstall bot maybe?


Learn how a basic lua script work by looking at this banker:

That's not going to work, having the money variable in global on top will make it count the manas once when you start the script up and then never change that amount.
Also when making examples please use correct tabbing so people learn that instead.

Petit Ours
01-31-2013, 12:17 PM
Yeah xD Srry about it i right it on the fly since i dont want to copy paste my own script ...

DarkstaR
01-31-2013, 02:47 PM
Are you going to Goroma? In that instance, Jack Fate appears in both Liberty Bay and Goroma - This is actually done because Tibia has two different creatures named Jack Fate in the two locations. The bot will find the first Jack Fate and call it a day, meaning it will only work on the first Jack Fate which you saw.

Xparn
01-31-2013, 03:11 PM
Are you going to Goroma? In that instance, Jack Fate appears in both Liberty Bay and Goroma - This is actually done because Tibia has two different creatures named Jack Fate in the two locations. The bot will find the first Jack Fate and call it a day, meaning it will only work on the first Jack Fate which you saw.

Came to the conclusion to use Targetting +


elseif (labelName == "FollowJack1-2") then
setWalkerEnabled(false)
setTargetingEnabled(true)
wait (1000, 1400)
setTargetingEnabled(true)
setWalkerEnabled(true)

Xparn
01-31-2013, 03:17 PM
You seem to have problems with everything, reinstall bot maybe?



That's not going to work, having the money variable in global on top will make it count the manas once when you start the script up and then never change that amount.
Also when making examples please use correct tabbing so people learn that instead.

No i'm not going to re-install anything because it's not problem with the bot, I'm having error's / bugs that is not reported obvoiusly on the forum... The Follow Script doesn't work with Jack Fate, as i said many times even if you guys saying it 'should' work.. it doesn't. Maybe it's like Darkstar said, even though that's something that should be announced and fixed, same with the bank function, as you have to deposit x gold to be able to make it count and withdraw the first function "[ManaGMPscost]"...

I have made it work now, with hard work thanks to myself and those who actually helped, and hell i learned so much more by getting via other persons than reading and understanding the code from someone else's code...

DarkstaR
01-31-2013, 03:18 PM
There's no bugs. The Creature.New() by name is intended to always grab first creature. The bank has no problem, you're doing something wrong.

Xparn
01-31-2013, 03:21 PM
There's no bugs. The Creature.New() by name is intended to always grab first creature. The bank has no problem, you're doing something wrong.

I tried it, didn't work... i know it's alot to ask but if you haven't tried at jack fate yet, please do it yourself and you'll see :)

I could post my code again, but it would be dismissed again, right? :)

DarkstaR
01-31-2013, 03:22 PM
I tried it, didn't work... i know it's alot to ask but if you haven't tried at jack fate yet, please do it yourself and you'll see :)

I could post my code again, but it would be dismissed again, right? :)

The fuck are you talking about, kid? I know it doesn't work. I explained why it doesn't work. I don't need to try anything. It's not a bug, it's how the code is intended to work.

Xparn
01-31-2013, 03:30 PM
The fuck are you talking about, kid? I know it doesn't work. I explained why it doesn't work. I don't need to try anything. It's not a bug, it's how the code is intended to work.
Thought you mean the Creature.Follow() but okey, as it's for both... why the heck wouldn't you make any effort to announce this or fix it? Whatever you calling it.

As the command Creature.Follow() < is supposed to follow x Creature, and it doesn't same with the other Creature.New() < if none if these work, and people wont understand why... the only thing you have to say in the end is "It's not a bug" but it's still a problem ain't it... If it's a easy fix i wish you make it.

And can you please stop acting like your above everyone else? If people are here to learn or to get help you think it's a nice thing to talk someone down with your lowering attitude?

DarkstaR
01-31-2013, 03:35 PM
Thought you mean the Creature.Follow() but okey, as it's for both... why the heck wouldn't you make any effort to announce this or fix it? Whatever you calling it.

As the command Creature.Follow() < is supposed to follow x Creature, and it doesn't same with the other Creature.New() < if none if these work, and people wont understand why... the only thing you have to say in the end is "It's not a bug" but it's still a problem ain't it... If it's a easy fix i wish you make it.

And can you please stop acting like your above everyone else? If people are here to learn or to get help you think it's a nice thing to talk someone down with your lowering attitude?

They work fine, you deaf motherfucker. I've explained this. They are intended to only work on the first creature with that name in the battlelist. The battlelist is a structure which can have duplicate names so, obviously, there is ambiguity - I may add a new way to do this, but the current way works as intended. Learn to fucking read, god dammit I'm closing your thread because you refuse to listen to anyone help and then bitch like a 6 year old as if people haven't been handing you code and explaining your issues.