Posted by : Unknown Minggu, 18 Januari 2015

Trainstation bot



I created a bot for the facebook game Trainstation. U might want to adjust it to personalize it for ur own needs/setup. But it is a good start for botting on any facebook game, that requires the same actions over and over again. Or/And color depending clicks/keyinputs.

Version update: 1.4

Feel free to use it  I wrote the script in ACTool so u will need to download ACTool from http://www.ACTool.net

I got alot of questions about the script and people tell me it doesnt work. If u want help to set up the trainstation bot, just pm me or connect to my teamspeak flum.aionallstars.com:11807

Code:
(*
Trainstation bot by flum

Have problems or questions feel free to contact me on teamspeak 3 Address: flum.aionallstars.com:11807

-Functions
Send your trains out every 10 minutes + goes to docking to click on the trains.
Delete flags for you. Keeps track and logs the amount of trains it dispatches.
Keeps tracks of errors, able to reconnect if ur internet connection restarts.
Makes screenshots of ur materials + exp bar.


-Requirements
Screen resolution 1366 768
Chrome or Firefox.
The 1 click passenger and cargo upgrade for ur station.
Basic knowledge about AC tool scripting

-Run notes
Start the script first, then within 5 sec open trainstation fullscreen.

-Config notes
If u set constants delflag 0 to anything else it will start to delete the amount of flags from the giftbox.
Change internation 0 if u dont want to send int trains.

0.2 send trains every 10 min
0.3 minor bug fixes
0.4 added del flag function
0.5 changed flag function for easy use
0.6 send int function added
0.7 click dockin station implemented
0.8 color check implemented for better check
0.9 changed mouse cord. for int trains
1.0 code clean up
1.1 error logger
1.2 train send tracker
1.3 screenshot material/exp
1.4 reconnecter


*)
constants
send
= 10
bar
= 1
delflag
= 0
train
= 0
run
= 0
dock
= 0
date
= 0
time
= 0
reason
= 0
trigger
= 0
main
= 1
end


constructs
File1=File
File2=File
File3=File
end

call setup
call main

procedure main
//Clicks on all the trains on the main screen
call flag
while $main = 1
compute trigger
= $trigger + 1 //set trigger timer
compute run
= $run + 1
MousePos 1251, 650
call cc
MousePos 1250, 639
call cc
MousePos 1250, 630
call cc
MousePos 1250, 619
call cc
MousePos 1250, 605
call cc
MousePos 1251, 592
call cc
MousePos 1251, 592
call cc
call errorlog
call dock
if $time > 3600000 //every hour make a screenshot of your materials and exp bar
call screenexp
call screenmaterial
call log
SetConst time = 0
SetConst train = 0
SetConst dock = 0
end
end
end

procedure flag
//If deflag set, delete $deflag number
if $delflag > 0
set main = 0
MousePos 71, 717
call click
MousePos 807, 238
call click
loop $delflag
MousePos 387, 420
call click
MousePos 734, 492
call click
end
else
end
end

procedure dock
//If dock is avaiable go there and click on the trains
LoadRGB 212, 69
if {RGBGreen} > 129
compute dock
= $dock + 1
MousePos 212, 69
call click
delay
2 sec
compute time
= $time + 2000
MousePos 1252, 667
call click
MousePos 1250, 656
call click
MousePos 1250, 646
call click
MousePos 1249, 636
call click
MousePos 1249, 625
call click
MousePos 1249, 616
call click
MousePos 1250, 609
call click
MousePos 30, 715
call click
delay
2 sec
compute time
= $time + 2000
else
//Timestamp DOK load screen not found Red {RGBRed} Blue {RGBblue} Green {RGBGreen}
end
end

procedure getcolor
//checks if the train clicked from main is a "dispatchable train" if yes dispatch it
delay
1 sec
compute time
= $time + 1000
LoadRGB 339, 143
if {RGBGreen} = 247
compute train
= $train + 1
CASE $send
when 6
MousePos 547, 421
when 10
MousePos 758, 419
if $trigger > 2
FormatDateTime date = {now}, m/d/yy h-n //If train is dispatched bot it still active
FileOpen File3, C:\train\a_active.txt
FileAppend File3
FileWrite File3, A
FileClose File3
setconst trigger
= 0
end
else
end
call click
else
end
end

procedure screenmaterial
//Makes a screenshot of your material
FormatDateTime date = {now}, m.d.yy h.n
MousePos 1319, 70
call click
SaveScreen C:\train\screens\material\$date .bmp
MousePos 590, 641
call click
end

procedure screenexp
//Makes a screenshot of your exp bar
FormatDateTime date = {now}, m.d.yy h.n
MousePos 774, 76
delay
500
compute time
= $time + 500
SaveScreen C:\train\screens\exp\$date .bmp
delay
500
compute time
= $time + 500
end


procedure errorlog
//Checks if there is any errors going on + handling them.
LoadRGB 634, 350
FormatDateTime date = {now}, m/d/yy h:n
case {RGBGreen}
when 173
setconst reason
= normal
when 160
setconst reason
= normal
when 28
setconst reason
= normal
when 254
setconst reason
= disconnect
when 236
setconst reason
= lvlup
when 8
setconst reason
= achievment
else
setconst reason
= undefined
end
if $reason = normal
else
FileOpen File2, C:\train\a_errorlog.txt //Logs any error
FileAppend File2
FileWrite File2, $date $reason Red {RGBRed} Blue {RGBblue} Green {RGBGreen}
FileClose File2
end
if $reason = achievment
MousePos 568, 582
call click
end
if $reason = disconnect
call reconnect
end
if $reason = lvlup
MousePos 568, 639
call click
end
end

procedure reconnect
//Reconnects
keys
{esc}
delay
2 sec
compute time
= $time + 2000
if $bar = 1
MousePos 537, 621
call click
else
MousePos 551, 663
call click
end
delay
10 sec
compute time
= $time + 10000
call setup
delay
5 sec
compute time
= $time + 5000
end

procedure setup
//Sets trainstation full screen
if $bar = 1
MousePos 1079, 331
call click
else
MousePos 1081, 373
call click
end
MousePos 780, 363
call click
MousePos 244, 717
call click
MousePos 541, 398
call click
delay
2 sec
compute time
= $time + 2000
MousePos 31, 735
call click
delay
2 sec
compute time
= $time + 2000
end


procedure log
//Keeps track on every train u dispatch, + amount of times it went to docks
FormatDateTime date = {now}, m/d/yy h:n
FileOpen File1, C:\train\a_trainlog.txt
FileAppend File1
FileWrite File1, $date - train: $train - dock: $dock - run: $run
FileClose File1
end

procedure cc
call click
call getcolor
end

procedure click
leftclick
delay
500
compute time
= $time + 500
end
If u dont get my trainstation bot working. Or u have questions, tips suggestions. Feel free to PM me your skype or connect to my teamspeak server: flum.aionallstars.com:11807 and i would be glad to help u out. Happy botting!

Leave a Reply

Subscribe to Posts | Subscribe to Comments

- Copyright © Droid Hack Frog - Skyblue - Powered by Blogger - Designed by Johanes Djogan -