Log in

View Full Version : I Came From Windbot



duuhduuh
09-20-2016, 12:58 PM
Hello,

After a long time using Windbot as main bot, I decided to get into a new "botting world". I`ll go right on subject: I`d like to know if there`s scripts like persistents and how to check if character need supply and others..

Is there any GOOD tutorial here? Or documentation with functions available?

Thanks in advance. Hope u help me!

Apoc
09-20-2016, 01:46 PM
What do u mean by persistents??

duuhduuh
09-20-2016, 02:11 PM
What do u mean by persistents??

In Windbot persistents are actions that repeat by itself like:
auto(200)
if $mppc < 10 then
cast(x)
else y end... So each 200 ms it will check if mana % is less than 10 and if positive will cast spell.

Apoc
09-20-2016, 02:20 PM
Oh snap u got me there, well maybe you should try the free scripts to check. Otherwise while using Xeno, I always used solid-scripts. best ones around. Maybe they work for what you want.

Trykon
09-20-2016, 02:33 PM
I would buy or download free script from me or Bollo as we don't encrypt them... there you will be able to see most of stuff happening.
You can just open .lua file to see everything: loops, resupplying, handling backpacks, etc...
Edit: ofc more advanced features are in paid ones...

Sargul
09-20-2016, 02:54 PM
I don't really recommend you start in XB, it won't continue for tibia 11. But if you are going to play ot well you are welcome here. ;)

duuhduuh
09-20-2016, 03:35 PM
I would buy or download free script from me or Bollo as we don't encrypt them... there you will be able to see most of stuff happening.
You can just open .lua file to see everything: loops, resupplying, handling backpacks, etc...
Edit: ofc more advanced features are in paid ones...

Thanks! I`ll download it and take a look on it to understand more.. One more doubt... In Windbot we name each backpack.. I mean that lootbp = blue backpack and so on.. In Xeno i saw that it's bp1, bp2, bp3.. What if I put mu looting in bp1 (as blue) and for some reason char closes all windows and open again with bp1 (as of holding) for example?

duuhduuh
09-20-2016, 03:37 PM
I don't really recommend you start in XB, it won't continue for tibia 11. But if you are going to play ot well you are welcome here. ;)

Yeah.. I`m OT player. Global isn`t the same... The reason I play Tibia is 75% scripting and 25% on screen playing.

Trykon
09-20-2016, 03:49 PM
Thanks! I`ll download it and take a look on it to understand more.. One more doubt... In Windbot we name each backpack.. I mean that lootbp = blue backpack and so on.. In Xeno i saw that it's bp1, bp2, bp3.. What if I put mu looting in bp1 (as blue) and for some reason char closes all windows and open again with bp1 (as of holding) for example?

That is why I told you too see scripts ;) we also name backpacks like in wb, official scripts and the ones from shadowart use bp1, ... etc.
Looter uses that as well, but all you need to do is to open them in right order, like: open first mainbp, then lootbp, then goldbp and then supplybp... like this all numbers are fine ;)
Take a look in .lua then you will see at label resetbp (on my scripts) you set them properly for looter to work

duuhduuh
09-20-2016, 04:13 PM
That is why I told you too see scripts ;) we also name backpacks like in wb, official scripts and the ones from shadowart use bp1, ... etc.
Looter uses that as well, but all you need to do is to open them in right order, like: open first mainbp, then lootbp, then goldbp and then supplybp... like this all numbers are fine ;)
Take a look in .lua then you will see at label resetbp (on my scripts) you set them properly for looter to work

Yeah... Guess is easy to learn the basics.. Saw that you registered a event at the beginning and then it goes with if and elseif so it recognize each waypoint and do the action for each one. BUT... ;) I case of server down. It will reopen bps or I'll have to do one "persistent" or a loop?

duuhduuh
09-20-2016, 04:27 PM
Adding another doubt: In "WB", I can use "islocation()" It will check if character is on that exactly sqm.. I use it after important ways like down stais.. After that I'll check if really is down.

shadowart
09-20-2016, 10:15 PM
WB needs islocation because it skips waypoints if you get stuck, XB doesnt unless you're on the wrong floor so you almost never need to do location checking.

duuhduuh
09-20-2016, 11:11 PM
WB needs islocation because it skips waypoints if you get stuck, XB doesnt unless you're on the wrong floor so you almost never need to do location checking.

In this case. If in wrong floor how I check it?

shadowart
09-20-2016, 11:47 PM
You can use Self.Position().z to check your z-coordinate. However, you don't need to do this after stuff like holes, ladders and stairs. Those waypoints are not going to fail. If you passed a rope waypoint you will always have managed to rope yourself up etc... Position checking are for when you custom lua code to move yourself around, like when you're opening and walking through a door.

Trykon
09-21-2016, 01:17 AM
Yeah... Guess is easy to learn the basics.. Saw that you registered a event at the beginning and then it goes with if and elseif so it recognize each waypoint and do the action for each one. BUT... ;) I case of server down. It will reopen bps or I'll have to do one "persistent" or a loop?

This is done in Bollo's free lua script that is available to download on his thread, my doesnt do that... also Solid Scripts and Official Xeno scripts do that, dunno about shadowart but I bet his as well...

duuhduuh
09-21-2016, 02:18 AM
This is done in Bollo's free lua script that is available to download on his thread, my doesnt do that... also Solid Scripts and Official Xeno scripts do that, dunno about shadowart but I bet his as well...

Well i'm creating something from 0. How my Walker know what .lua file im using?

Trykon
09-21-2016, 08:19 AM
Well i'm creating something from 0. How my Walker know what .lua file im using?

Instead creating label to reset or open bps you need module that will open them when they are closed. This will be loop that simply checks if given color bps are open (could be just check if main bp is open). This should stop the walker, close bps (in case you lost only one), open them and start the walker again.
This is the function like registerevent or something, forgot that as I always copy and past this bit xD you can check it in the scripts, then if you have it you need to just execute this script in client using scripter

duuhduuh
09-21-2016, 03:59 PM
Instead creating label to reset or open bps you need module that will open them when they are closed. This will be loop that simply checks if given color bps are open (could be just check if main bp is open). This should stop the walker, close bps (in case you lost only one), open them and start the walker again.
This is the function like registerevent or something, forgot that as I always copy and past this bit xD you can check it in the scripts, then if you have it you need to just execute this script in client using scripter

First i`d like to thank you for helping me.. Second (kkk) i`m not familiar with Module. Do you have some example or any tutorial of it or just explain how it works?

Trykon
09-21-2016, 04:55 PM
First i`d like to thank you for helping me.. Second (kkk) i`m not familiar with Module. Do you have some example or any tutorial of it or just explain how it works?
It works like while loop through the whole script, but is not disrupting other scripts and modules... I use this for example to fill supply bps, refilling mana when no monsters on screen or ignore monsters when low ammo. Download my free rp 15+ ankrahmun tarpit tomb to see the structure. It is at the bottom of lua script

duuhduuh
09-22-2016, 01:55 PM
Thanks!

Another one.. Now in Depositer.. I`ll explain how I do in Windbot:

Action:
01. Open MainBP

02. Open LootBP (And keep going through all other bps inside with same color until no more bps available to open.. I mean he open the LootBP to the last one even if no more items on it..)

03. Open Depot Chest

04. Open ONE backpack inside Depot Chest with another 20 backpacks (2 stack and 18 non-stack)

05. Then he goes through the loot backpacks from end to the begining one by one until it gets to the MainBP taking each loot for it respective category (a=stack b=nonstack)

Any idea how I can do this? Remember i`m playing in OTSERVER and I don`t have the new depot chest (with 16 (?) other depot - 1 for each city inside)

Trykon
09-22-2016, 03:34 PM
Thanks!

Another one.. Now in Depositer.. I`ll explain how I do in Windbot:

Action:
01. Open MainBP

02. Open LootBP (And keep going through all other bps inside with same color until no more bps available to open.. I mean he open the LootBP to the last one even if no more items on it..)

03. Open Depot Chest

04. Open ONE backpack inside Depot Chest with another 20 backpacks (2 stack and 18 non-stack)

05. Then he goes through the loot backpacks from end to the begining one by one until it gets to the MainBP taking each loot for it respective category (a=stack b=nonstack)

Any idea how I can do this? Remember i`m playing in OTSERVER and I don`t have the new depot chest (with 16 (?) other depot - 1 for each city inside)

That will be a longer script
You need to:
Reach depot (in build in walker)
Open main bp
Open loot bp
Open depot chest
Start loop:
Open first stack bp and nonstack bp
Throw items from lootbp to given bps until:
There is no more items in loot bp or thete is only container, if so open it
There is no more space in item or stack bp, if so, close it and open next bp of the dame color
And do this until loot bp is not empty, or you have not enough space in bps id depot then break and disable walker just to be sure you are not going on hunt with these

duuhduuh
09-22-2016, 04:17 PM
That will be a longer script
You need to:
Reach depot (in build in walker)
Open main bp
Open loot bp
Open depot chest
Start loop:
Open first stack bp and nonstack bp
Throw items from lootbp to given bps until:
There is no more items in loot bp or thete is only container, if so open it
There is no more space in item or stack bp, if so, close it and open next bp of the dame color
And do this until loot bp is not empty, or you have not enough space in bps id depot then break and disable walker just to be sure you are not going on hunt with these

Damn! What if I use the Deposit Items built in? How it works? (Obviously he deposit items) kkkk but how? He uses one backpack or chest boxes?

Trykon
09-22-2016, 04:23 PM
Probably will use stacked bps, just stack them properly, put first bp in chest for items and second for stacks, then make sure you have one bp in another and so on... this should work... but built in depositet doesnt open next bps in loot bp, so you would need to separate items from stacks and if there is constantly dropping item then it should even have separated bp

duuhduuh
09-22-2016, 04:30 PM
Probably will use stacked bps, just stack them properly, put first bp in chest for items and second for stacks, then make sure you have one bp in another and so on... this should work... but built in depositet doesnt open next bps in loot bp, so you would need to separate items from stacks and if there is constantly dropping item then it should even have separated bp

Hmm i`ll think about it and try to sketch something.. Later i`ll post if work or not

Trykon
09-22-2016, 04:35 PM
Next time i am available on saturday, as today i work evening and tomorrow double shift so i will only answer theou phone like today anyway

duuhduuh
10-07-2016, 11:43 AM
I'm going well on doing my own scripts... But today I saw that sometimes my char doesn't resupply. He just say "hi, trade" then follow to the next waypoint. So I turn walker off > go for resupply label again and then he resupply correctly.. But i'm not watching 100% of time to see when he buy or not... Any idea?

local HealthPOT = "Ultimate Spirit Potion"
local HealthMAX = 150
local HealthMIN = 50
local HealthToBuy = math.abs(HealthMAX-Self.ItemCount(HealthPOT))

local ManaPOT = "Strong Mana Potion"
local ManaMAX = 400
local ManaMIN = 100
local ManaToBuy = math.abs(ManaMAX-Self.ItemCount(ManaPOT))

elseif (labelName == "Resupply") then
Walker.Stop() -- Wait if 5000 because I was trying to delay some to see if it works properly.
Self.SayToNpc({"hi", "trade"}) wait(5000)
Self.ShopBuyItem(HealthPOT, HealthToBuy)wait(5000)
Self.SayToNpc({"bye", "hi", "trade"}) wait(5000) -- I used this way because sometimes he skips HealthPOT and buy only ManaPOT.
Self.ShopBuyItem(ManaPOT, ManaToBuy) wait(5000)
Walker.Start()

Trykon
10-07-2016, 12:10 PM
elseif(labelName == "BuyPots")then
Walker.Stop()
Self.SayToNpc("hi")
wait(200,1000)
Self.SayToNpc("trade")
wait(200, 1000)
Self.ShopBuyItemsUpTo(HpPot, HpMax)
wait(200, 1000)
Self.ShopBuyItemsUpTo(ManaPot, ManaMax)
wait(1000)
Walker.Start()

this is my that I use

duuhduuh
10-07-2016, 01:12 PM
Thanks. I'll try that!

duuhduuh
10-07-2016, 09:50 PM
No way working. I tryed different times... Char say "hi, trade" and go out.
Edit: LOL... Just told ya and worked!

Trykon
10-07-2016, 11:20 PM
So you r ready to make full afk scripts?

shadowart
10-09-2016, 09:08 AM
elseif(labelName == "BuyPots")then
Walker.Stop()
Self.SayToNpc("hi")
wait(200,1000)
Self.SayToNpc("trade")
wait(200, 1000)
Self.ShopBuyItemsUpTo(HpPot, HpMax)
wait(200, 1000)
Self.ShopBuyItemsUpTo(ManaPot, ManaMax)
wait(1000)
Walker.Start()

this is my that I use
A 200-1000ms wait after saying "trade" is a bit short. I think you'll find that a lot of people will fail to trade when the wait time falls on the lower end of that range. Personally I use 1200ms + Self.Ping() as a minimum, but when you're selling stuff it's actually possible to use the sale count to accurately determine whether the trade window is open yet (the sale count will always be 0 if the trade window isn't open).

Also, there is no need to use Walker.Stop/Walker.Start at labels, the bot walker automatically stops while it is executing code at labels.

Trykon
10-09-2016, 09:39 AM
A 200-1000ms wait after saying "trade" is a bit short. I think you'll find that a lot of people will fail to trade when the wait time falls on the lower end of that range. Personally I use 1200ms + Self.Ping() as a minimum, but when you're selling stuff it's actually possible to use the sale count to accurately determine whether the trade window is open yet (the sale count will always be 0 if the trade window isn't open).

Also, there is no need to use Walker.Stop/Walker.Start at labels, the bot walker automatically stops while it is executing code at labels.

about stop you are right, it is just something I do since I started scripting :)
about 200ms... never had problems with this myself, as the mater of fact i have wait(200) used on deposit gold label, works perfectly

shadowart
10-09-2016, 11:20 AM
about stop you are right, it is just something I do since I started scripting :)
about 200ms... never had problems with this myself, as the mater of fact i have wait(200) used on deposit gold label, works perfectly
How long wait you need is different for different persons on different computers and different connections. When you share scripts with others you have to take care so that they work for people with high ping and frequent freezes. Also, the wait doesnt matter at all on deposit gold. It's when you're trading that it is important, it takes some extra time for the trade window to open after you say "trade" and if the trade window isnt open when you call the selling function it will see that you don't have any sellable items and walk away without selling anything. This is exactly what happened for Duuhduuh here, changing the wait to 5000ms is a bit overkill but increasing the wait time was the right move.

Trykon
10-09-2016, 11:51 AM
How long wait you need is different for different persons on different computers and different connections. When you share scripts with others you have to take care so that they work for people with high ping and frequent freezes. Also, the wait doesnt matter at all on deposit gold. It's when you're trading that it is important, it takes some extra time for the trade window to open after you say "trade" and if the trade window isnt open when you call the selling function it will see that you don't have any sellable items and walk away without selling anything. This is exactly what happened for Duuhduuh here, changing the wait to 5000ms is a bit overkill but increasing the wait time was the right move.

yup you r right :)

duuhduuh
10-11-2016, 02:06 PM
U both are great! My script is working. One question is if Safe PVP works on OTSERVERS. I actually used like I saw in another thread = 1st priority GFB and second SD then if player on screen then fall to SD.. Is it correct? But got PK..

Another doubt is that in "WB" I used a "context menu>invite to party if not invited and join party if invited". How can I make it?