This is not C or C++. This is Groovy, which is based on Java.danvath wrote:It depends on your computer, each computer has different representations for int, float, double, etc... There is a test to see, I think it goes something like:
In a dos box:
run like a hellow world app, but then include
printf (cout, printline, whatever your languages command for printing to screen is) << float
printf << double
printf << int
This should make it print to screen what your computer can set the maximum value to. I think the maximum for int is in the thousands, but that i<200 can still cause many problems. In a situation like this were you don't know exactly how long you need it to run its best to do a do while or while loop. This way you do not need to specify i<200 and you can continue on. So like while(logs<400) go on from there. This way instead of it being 200 run throughs of the code, which can still cause I to go up without collecting a log, now you have it running until it collects 400 logs.
Jester87's Bot Tutorial For Newbies
Moderator: Phades
-
Oddity
- Posts: 1983
- Joined: Sun Jun 20, 2010 12:04 am
- Location: BC, Canadia
Re: Jester87's Bot Tutorial For Newbies
jadamkaz wrote:ah i remember my run in with odditown they are good ppl im sure the only reason they killed ME is because they are troll hunters and i was a troll
-
danvath
- Posts: 84
- Joined: Fri Nov 26, 2010 2:05 am
Re: Jester87's Bot Tutorial For Newbies
Haven't messed with Java or groovy much yet, plan on doing so when I got some free time soon. Jester you said you got it cleaned up some, what you do to get some kinks out?
-
Jester87
- Posts: 195
- Joined: Mon Dec 12, 2011 8:19 am
- Location: Hell
Re: Jester87's Bot Tutorial For Newbies
I added an additional line to make it drop the log before checking to chop. Not really sure if it is working, though.danvath wrote:Haven't messed with Java or groovy much yet, plan on doing so when I got some free time soon. Jester you said you got it cleaned up some, what you do to get some kinks out?
w6: Diet Pepsi (RIP), Mountain Dew (RIP), Peppermint Bark
Bot Tutorial for Noobs - viewtopic.php?f=27&t=24881&p=307831#p307831
Mvpeh Song - viewtopic.php?f=7&t=24872
Parchir Song -viewtopic.php?f=7&t=24587
Bot Tutorial for Noobs - viewtopic.php?f=27&t=24881&p=307831#p307831
Mvpeh Song - viewtopic.php?f=7&t=24872
Parchir Song -viewtopic.php?f=7&t=24587
-
danvath
- Posts: 84
- Joined: Fri Nov 26, 2010 2:05 am
Re: Jester87's Bot Tutorial For Newbies
For picking up the extra logs you could add a if statement before finding a tree to look for a log, that way it would grab that before chopping a new tree down.
-
Jester87
- Posts: 195
- Joined: Mon Dec 12, 2011 8:19 am
- Location: Hell
Re: Jester87's Bot Tutorial For Newbies
Yeah, its just a matter of adding the loops. Think you could tackle it?danvath wrote:For picking up the extra logs you could add a if statement before finding a tree to look for a log, that way it would grab that before chopping a new tree down.
w6: Diet Pepsi (RIP), Mountain Dew (RIP), Peppermint Bark
Bot Tutorial for Noobs - viewtopic.php?f=27&t=24881&p=307831#p307831
Mvpeh Song - viewtopic.php?f=7&t=24872
Parchir Song -viewtopic.php?f=7&t=24587
Bot Tutorial for Noobs - viewtopic.php?f=27&t=24881&p=307831#p307831
Mvpeh Song - viewtopic.php?f=7&t=24872
Parchir Song -viewtopic.php?f=7&t=24587
-
exiva
- Posts: 3
- Joined: Tue Jan 17, 2012 7:10 am
Re: Jester87's Bot Tutorial For Newbies
I got the bot client working and I added ur script as groovy file.
Can't run it tho by typing
Also tried adding to hotkey.. nothing happens.. My char just says what I typed.
But if I click f1 then some other script starts that want me to mark 2 different tiles.
How do we know what exactly the already existing scripts do?
Hope we get a curio gathering bot soon
Can't run it tho by typing
Code: Select all
bot loggin_botAlso tried adding to hotkey.. nothing happens.. My char just says what I typed.
But if I click f1 then some other script starts that want me to mark 2 different tiles.
How do we know what exactly the already existing scripts do?
Hope we get a curio gathering bot soon
-
BangPow
- Posts: 427
- Joined: Tue May 31, 2011 4:15 am
- Location: Now.......... Awakened
Re: Jester87's Bot Tutorial For Newbies
Jester thanks for all your help. Thank you for putting up with my dumb ass.
Before enlightenment - chop wood, carry water. After enlightenment - chop wood, carry water. ~Zen Buddhist Proverb
-
BangPow
- Posts: 427
- Joined: Tue May 31, 2011 4:15 am
- Location: Now.......... Awakened
Re: Jester87's Bot Tutorial For Newbies
Jester thanks for all your help. Thank you for putting up with my dumb ass.
Before enlightenment - chop wood, carry water. After enlightenment - chop wood, carry water. ~Zen Buddhist Proverb
-
Jester87
- Posts: 195
- Joined: Mon Dec 12, 2011 8:19 am
- Location: Hell
Re: Jester87's Bot Tutorial For Newbies
No problem. Sorry I had to go to bed.BangPow wrote:Jester thanks for all your help. Thank you for putting up with my dumb ass.
You'll want to make sure the bot script is placed in the scripts folder, and you will want to make sure it has a .groovy extension. After that, while you are in game hit colon ":" and then set_bot1 logger_bot
Or you can rename your bot to something simple like logger.
w6: Diet Pepsi (RIP), Mountain Dew (RIP), Peppermint Bark
Bot Tutorial for Noobs - viewtopic.php?f=27&t=24881&p=307831#p307831
Mvpeh Song - viewtopic.php?f=7&t=24872
Parchir Song -viewtopic.php?f=7&t=24587
Bot Tutorial for Noobs - viewtopic.php?f=27&t=24881&p=307831#p307831
Mvpeh Song - viewtopic.php?f=7&t=24872
Parchir Song -viewtopic.php?f=7&t=24587
-
exiva
- Posts: 3
- Joined: Tue Jan 17, 2012 7:10 am
Re: Jester87's Bot Tutorial For Newbies
It is in script folder with groovy extension already and I just tried placing the ":" before the command and it didn't make any difference.Jester87 wrote:No problem. Sorry I had to go to bed.BangPow wrote:Jester thanks for all your help. Thank you for putting up with my dumb ass.
You'll want to make sure the bot script is placed in the scripts folder, and you will want to make sure it has a .groovy extension. After that, while you are in game hit colon ":" and then set_bot1 logger_bot
Or you can rename your bot to something simple like logger.