Você está na página 1de 6

program MM_Itembuyer; {$DEFINE SMART8} {$I SRL-OSR/SRL.

Simba} { FOR THE SCRIPT TO RUN CORRECTLY, THE FOLLOWING PARAMETERS MUST BE DEFINE: --max_Avg: integer - the max amount per item you wish to spend, averaged over many purchases (if you would like to spend a max of 100gp, set this to 100) - For the code to be more random, sometimes it will buy more or less than the max_Avg price; so it could buy more or less stock accordingly. (I.e. the shop runs out of stock before buyItems is finished, and it tri es to continue buying 0 stock...) --total_BUY : integer - the total amount of items you wish to purchase during this session --shop: integer: 0..2; select the shop you want to buy items from - 0: Port Sam - 1: Etc. - 2: Etc. --next_World : integer : choose random select or sequential select - 0: random - 1: sequential --bool_world : boolean : choose between increasing or decreasing - true : increasing - false : decreasing --start_world, end_world : integer : start and end worlds - if you want to start at world 350, start_world = 350. ~~~~~~~_----___--_-___ WELCOME TO THE SCRIPT!!___-_--___----_~~~~~~~ ~~~~~~~_----___--_ READ ABOVE FOR STARTING PARAMS!!_--___----_~~~~~~ ~~~~~~~_----___--_-___ WELCOME TO THE SCRIPT!!___-_--___----_~~~~~~~ } CONST max_Avg = 4; // averaged max amount to spend per item total_BUY = 100000; // total amount of items to buy shop = 0; next_World = 0; //random or increasing start_World = 301; //if increasing, then start at .. end_World = 378; // end at.. bool_World = true; //leave alone var i, u, x,y, is_Buy, max_Buy : integer; counter_World : integer; GLOBAL_BOUGHT : integer; GLOBAL_PRICE : integer; test_PRICE : boolean; ownerName, itemName : string; runTimeLimit, startTime : integer; ownerColor_1, ownerColor_2, itemColor_1, itemColor_2 : integer;

itemName_1, itemName_2,itemName_3 : string; Procedure DeclarePlayers; Begin HowManyPlayers := 1; NumberOfPlayers(HowManyPlayers); CurrentPlayer := 0; Players[0].Name := 'iliketosnipe'; //Enter Username Players[0].Pass :='jiggaboojones'; //Enter Password Players[0].Nick :='jeff'; //Enter Nick Players[0].Active:=True; End; { Declare Shop Uses the following parameters, if they aren't already defined add them using the following template: ownerName = ''; itemName = ''; ownerColor_1 = ; itemColor_1 = ; ownerColor_2 = ; itemColor_2 = ; -- ownerColor_1,..,itemcolor_2: integer - must be filled out with two unique colors (USE COLOR PICK TOOL) of the shop owner and the respective item to purchase -- ownerName and itemName: string - ownerName = 'errant' for shop owner Gerrant ownerName = '' for shop owner (_) - itemName = 'eather' for shop item Feather itemName = '' for shop item (_) } procedure DeclareShop; begin case shop of 0: begin // port sam ownerName := 'Aubery'; itemName := 'ody'; ownerColor_1 := 1887980; itemColor_1 := 13639447; ownerColor_2 := 8553100; itemColor_2 := 13639447; max_Buy := max_Avg; end; 1: begin //custom shop variables ownerName := 'Aubery'; itemName := 'ater'; ownerColor_1 := 1887980; itemColor_1 := 11082774; ownerColor_2 := 6250343; itemColor_2 := 8553100; max_Buy := max_Avg; end; 2: begin //another ownerName := 'Aubery'; itemName := 'ind'; ownerColor_1 := 1887980; itemColor_1 := 1738976; ownerColor_2 := 8553100; itemColor_2 := 1738976; max_Buy := max_Avg;

end; end; case itemName of 'ody' : begin itemName_1:=itemName; itemName_2:='ody'; itemName_3:='Body'; end; 'ind' : begin itemName_1 := itemName; itemName_2:='ind'; itemName_3 :='Mind'; end; 'ater' : begin itemName_1 := itemName; itemName_2:='ater'; itemName_3 :='Water'; end; end; end; procedure DeclareVar; begin i :=0; u := 0; GLOBAL_BOUGHT := 0; test_Price := false; counter_World := 0; GLOBAL_PRICE := -1; runtimelimit := randomrange(5850000,21600000); end; procedure findOwner; var c1, c2 : integer; begin MakeCompass(randomrange(0,360)); if FindObjCustom(c1, c2, ['alk-to', ownerName], [ownerColor_1, ownerColor_2], 5) then begin MouseBox(c1,c2,c1+4,c2+4,mouse_right); ClickMouse2(mouse_right); wait(RandomRange(200,950)); ChooseOptionMulti (['Trade']); wait(400 + randomrange(580,1280)); end; end; procedure buyItems(xx, yy, uu : integer); begin repeat wait(RandomRange(90,250)) MouseBox(xx, yy, xx+randomrange(0,5), yy++randomrange(0,5), mouse_right) wait(randomrange(100,299)) ChooseOptionMulti(['10']) uu := uu -1; until(uu <0) end; procedure checkPrice(hello,love:integer); var price :integer; price_Str : string; begin price := -1; price_Str := 'code' MouseBox(x-2,y-2,x+4,y+4,mouse_left) wait(randomrange(400,1000)); price_Str := GetChatBoxText(8,0); wait(randomrange(140,800)); if GetNumbers(price_Str) = '' then begin

price := max_BUY writeln('testing error code 130'); end else begin price := StrToInt(GetNumbers(price_Str)); end; if price<=max_Buy then begin case shop of 0: begin // this method is optimized to buy feathers with max_avg around 6-8ea. case price of // change it as you see fit 1..2 : begin u := randomrange(75,75); //change randomrange(50,55) to what you need GLOBAL_BOUGHT := GLOBAL_BOUGHT + (u*10); writeln('Buying ' + IntToStr(10*u) + ' of item(s)') buyItems(hello,love,u); wait(randomrange(300,1200)); end; 3..4 : begin u:= randomrange(75,75) //will buy in multiples of 10 GLOBAL_BOUGHT := GLOBAL_BOUGHT + (u*10); writeln('Buying ' + IntToStr(10*u) + ' item(s).') buyItems(hello,love,u); wait(randomrange(300,1200)); end; 4..7 : begin u:= randomrange(20,25) //so if you want 100 to 120 items.... GLOBAL_BOUGHT := GLOBAL_BOUGHT + (u*10); writeln('Buying ' + IntToStr(10*u) + ' item(s).') buyItems(hello,love,u); wait(randomrange(300,1200)); end; price>=max_buy : begin u := randomrange(10,12); //copy this line of code GLOBAL_BOUGHT := GLOBAL_BOUGHT + (u*10); writeln('Buying ' + IntToStr(10*u) + ' of item(s)') buyItems(hello,love,u); wait(randomrange(300,1200)); end; end; end; 1 : begin u := randomrange(75,75); //buy 100-120 items at a time GLOBAL_BOUGHT := GLOBAL_BOUGHT + (u*10); writeln('Buying ' + IntToStr(10*u) + ' of item(s)') buyItems(hello,love,u); wait(randomrange(300,1200)); end; 2: begin { room to make custom item-buying routine } end; end; end; if price>max_Buy then begin test_PRICE :=false; end;

if price = -1 then begin writeln('error!!') test_Price :=false; end;

end; procedure ExitShop; begin wait(randomrange(500,2500)); MouseBox(482, 35, 492, 45, mouse_left); end; procedure SwitchWorld(someWorld : integer); begin wait(randomrange(650,10000)); case someWorld of 0: begin ChangeWorld(RandomWorld); end; end; case someWorld of 1: begin if bool_World then repeat if start_World + counter_World < end_world then begin SelectWorld(start_world + counter_World); counter_World := counter_World + 1; break; end; if start_World + counter_World = end_world then begin SelectWorld(end_World); counter_World := 0; break; end; until(CurrentWorldLS = Start_World + Counter_World); if not bool_World then begin repeat if start_World - counter_World > end_world then begin SelectWorld(start_world - counter_World); counter_World := counter_World + 1; break; end; if start_World - counter_World = end_world then begin SelectWorld(end_World); counter_World := 0; break; end; until(CurrentWorldLS = start_World - Counter_World); end; end; end; end;

begin SetupSRL; SMART_FIXSPEED := TRUE; ActivateClient; DeclarePlayers; DeclareVar; DeclareShop; LogInPlayer; MarkTime(StartTime); repeat writeln('Items bought: '+IntToStr(GLOBAL_BOUGHT)+'/'+ IntToStr(total_BUY)) if (LoggedIn) then begin wait(randomrange(350,850)) // MakeCompass('E') SetAngle(0); repeat // writeln('Attempting to find owner..') findOwner; until(FindObjCustom(x,y, ['alue', itemName], [itemColor_1, itemColor_2],5)) wait(randomrange(100,400)); // if FindObjCustom(x,y, ['alue', itemName], [itemColor_1, itemColor_2],2)then if IsUpTextMultiCustom([itemName_1, itemName_2, itemName_3]) then begin repeat checkPrice(x,y); until(not(test_PRICE)) end; end; ExitShop; Logout; if TimefromMark(StartTime) > runtimelimit then begin if runtimelimit >= 14000000 then begin wait(randomrange(1723520,4503200)); MarkTime(StartTime); end; if runtimelimit < 14000000 then begin wait(randomrange(520000,1800000)); MarkTime(StartTime); runtimelimit := randomrange(5850026,21600000); end; end; SwitchWorld(next_World); wait(RandomRange(380, 8500)); LogInPlayer; FreeSRL; until(GLOBAL_BOUGHT > total_BUY) end.

Você também pode gostar