Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program rsos;
- {$include_once lib/HeavenBot.simba}
- procedure sambuka;
- begin
- checkInventory();
- if (account.inventory_full = true) then
- begin
- teleport('falador');
- walk('bank');
- npc('grey_banker', 'bank');
- item('wine_of_zamorak', 'deposit_all');
- closeBank();
- end
- else
- begin
- if (searchForFlag(DTM.path.zamorak_palace[11])) then
- begin
- repeat
- telegrab();
- waitForItem('wine_of_zamorak');
- checkInventory();
- until (account.inventory_full = true)
- end
- else
- begin
- walk('zamorak_palace');
- end;
- end;
- end;
- /heavenbot include
- {$i srl-6/srl.simba}
- {$I RSWalker/Walker.simba}
- {$include_once lib/types.simba}
- {$include_once lib/config.simba}
- {$include_once lib/DTM.simba}
- {$include_once lib/other.simba}
- {$include_once lib/search.simba}
- {$include_once lib/cursor.simba}
- {$include_once lib/interface.simba}
- {$include_once lib/inventory.simba}
- {$include_once lib/spellbook.simba}
- {$include_once lib/walking.simba}
- {$include_once lib/npc.simba}
- {$include_once lib/bank.simba}
- {$include_once lib/objects.simba}
- {$include_once lib/system.simba}
- /config include
- // ------------ Main variables ------------ //
- var bot_wait = 500;
- var bot_loop = true;
- var bot_isWaiting = false;
- var screen: coord;
- var cursor: coord;
- var last_cursor: coord;
- var searching: coord;
- var osrs: app;
- var account: user;
- var last_path_flag: integer;
- var DTM: target;
- var RSW: TRSWalker;
- var RSW_test: TRSPosFinder;
- var path: TPointArray;
- var loc: TPoint;
- var t: UInt32;
- var walker_set = false;
- var testing = true;
- procedure configurate()
- begin
- SetDesktopAsClient();
- MoveMouse(0, 0);
- account.username := '';
- account.password := ';
- account.online := false;
- account.inventory_full := false;
- cursor.x := 0;
- cursor.y := 0;
- osrs.running := false;
- end;
- //system include
- // ------------ Start OSRS ------------ //
- Function startOsrs(): Boolean;
- begin
- execute();
- repeat
- if (FindAndSetTarget('Old School RuneScape', true) = True) then
- begin
- console(['loaded - osrs.exe']);
- osrs.running := true;
- end
- until(osrs.running = true);
- end;
- // ------------ Check All Running Processes ------------ //
- Function checkOsrsRunning(): Boolean;
- var running: boolean;
- begin
- running := FindAndSetTarget('Old School RuneScape', true);
- if (running = True) then
- begin
- console(['osrs.exe is running']);
- end
- else
- begin
- console(['starting osrs.exe']);
- startOsrs();
- end;
- GetClientDimensions(screen.x, screen.y);
- screen.x := 764-1;
- screen.y := 502-1;
- console(['size: ', screen.x, 'x', screen.y]);
- MouseSetClientArea(33, 36, 797, 538);
- ImageSetClientArea(33, 36, 797, 538);
- end;
- procedure doPage(page: integer)
- begin
- case page of
- 1: begin
- console(['page - loading']);
- end
- 2: begin
- console(['page - welcome']);
- clickButton('existing_user', 125, 30);
- end
- 3: begin
- console(['page - Not a member']);
- clickButton('switch_world', 90, 25);
- end
- 4: begin
- console(['page - worlds']);
- clickButton('w_394', 80, 15);
- clickButton('login', 125, 32);
- end
- 5: begin
- console(['page - start']);
- clickButton('play', 220, 80);
- end
- 6: begin
- console(['page - Bad username or password']);
- clickButton('try_again', 125, 30);
- clickButton('cancel', 125, 30);
- end;
- 7: begin
- console(['page - login']);
- typeText(account.username);
- Wait(250+Random(250));
- PressKey(13);
- Wait(250+Random(500));
- console(['Typing password']);
- typeText(account.password);
- Wait(500+Random(500));
- clickButton('login', 125, 30);
- end;
- end;
- end;
- // ------------ Initialize ------------ //
- Function initialize(): Boolean;
- begin
- configurate();
- setDTM();
- checkOsrsRunning();
- repeat
- osrs.page := determinePage();
- if (osrs.page = 0) then // Game screen
- begin
- if (testing = true) then
- begin
- if (walker_set = false) then
- begin
- RSW_test.Init(w_getClientPID());
- RSW_test.UpdateMap(True);
- walker_set := true;
- end;
- RSW_test.DebugPos(loc);
- end
- else
- begin
- sambuka;
- end;
- end
- else
- begin // Login screen
- doPage(osrs.page);
- end;
- wait(Random(800));
- until(bot_loop = false);
- end;
- // ------------ Main Function ------------ //
- begin
- initialize();
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement