How can i add eating to my autofighter (07scape)
Thank you for help!
How can i add eating to my autofighter (07scape)
Thank you for help!
...
is it OSR or P07, ive done both. You will need to do a combination of reading how many green pixels are left in your hp, pixel shift, and checking skills tab
Last edited by Sk1nyNerd; 05-07-2013 at 04:47 PM.
View my OSR Script Repository!
Botted to max
Guides: How to Report Bugs to the Scripter
~~~~ Moved to Java. Currently Lurking ~~~~
Simba Code:do begin Name := ''; Pass := ''; Active := True; end; end; //More human like movement Procedure HumanMove; Begin case random(200) of 1..160: MMouse(RandomRange(X - 7, X + 7), RandomRange(y - 7, y + 7), 0, 0); 161..190: MMouse(RandomRange(X - 9, X + 9), RandomRange(y - 9, y + 9), 0, 0); 191..200: MMouse(RandomRange(X - 12, X + 12), RandomRange(y - 12, y + 12), 0, 0); End; End; procedure Antiban; begin case Random(100) of 1: HoverSkill('strenght', False); 2: HoverSkill('random', False); 3: Boredhuman; 4: Wait(2500 + random(4500)); 5: HoverSkill('attack', False); 6: PickUpMouse; 7: RandomMovement; 8: RandomRClick; end; end; procedure MiniBreaker; begin case Random(160) of 1: Wait(4000 + random(7400)); 2: Wait(2550 + random(8550)); 3: Wait(6004 + random(6759)); 4: Wait(2040 + random(2549)); end; end; procedure ClickGoblin; begin if (not LoggedIn) then begin LogInPlayer; MakeCompass('N'); KeyDown(VK_UP); Wait(RandomRange(1500, 2500)); KeyUp(VK_UP); end; repeat repeat wait(1200); until (FindColor(x, y, greenLifeBar, 206, 127, 298, 196) = false); if FindObjCustom(x, y, ['Goblin'], [goblinCOLOR1, goblinCOLOR2], 25) then begin x := x - 40; y := y - 40; if x < 0 then begin x := 0; end; if y < 0 then begin y := 0; end; end else begin KeyDown(VK_RIGHT); repeat Wait(RandomRange(50, 100)); until (FindObjCustom(x, y, ['Goblin'], [goblinCOLOR1, goblinCOLOR2], 5)) KeyUp(VK_RIGHT); end; if FindColor(x1, y1, greenLifeBar, x, y, x + 40, y + 40) = false then begin x := x + 40; y := y + 40; MMouse(x, y, 3, 3); Writeln('Goblins..Lets get experience!'); ClickMouse2(mouse_left); end else begin case Random(2) of 0: Antiban(); 1: MiniBreaker(); end; end; wait(2000); until (false) end; begin ClearDebug; SetupSRL; DeclarePlayer; ActivateClient; Wait(2000); ClickGoblin; end.]
Last edited by Poppee; 05-07-2013 at 05:29 PM.
...
use a for...to...do loop for eating and check hp by finding hp bar color in a box that is ~in the middle of the MainScreen.
Cant find any tutorial about loop eating
...
another way you can do it is to get your hp from the skill tab (the top number) and say if that is below a certain value, then eat.
Could u add some code here ? : D
How do i add this to my script.. tried kinda many ways
Simba Code:, [foodcolor1, foodcolor2, foodcolor3], 10, 50, MIX1, MIY1, MIX2, MIY2) THEN begin status := ' eating' MouseBox(X+3, Y+3, X+3, Y+3, mouse_left); sleep(1000+random(1000)) gametab(tab_stats) end else begin status := ' out of food, logging out after 20 seconds' TabDTM := DTMFromString('m1gAAAHic42JgYOAFYmkg5gJiESBmBWJ+BgSQhmKQOh4kvjRUXgKqlw2IRYE4KykJSDISxP8ZiAOETYJgBAAAz9MDgg=='); if FindDTM(TabDTM, x, y, MIX1, MIY1, MIX2, MIY2) then begin MouseBox(X+1, Y+1, X+1, Y+1, mouse_left); sleep(10000+random(4000)) logout; FreeDTM(TabDTM); terminatescript; end; end end end end;]
Last edited by Poppee; 05-07-2013 at 05:57 PM.
...
i think that was aimed at me ??? well here's a snippet of how i sometimes eat ...
foodDTM is set at the beginning when the user chooses which type of food they will be usingCode:procedure Eat; var hitpoints, xc, yc: Integer; begin gametab(tab_stats); MyDeBug('Started eat'); hitpoints := getskillinfo('hp', True); if hitpoints < 10 then begin GetMeOutOfHere; end; if hitpoints < 30 then begin MyDeBug('hp below 30, time to eat'); gametab(tab_inv); FindNormalRandoms; if FindDTM(foodDTM, xc, yc, MIX1, MIY1, MIX2, MIY2) then begin MyDeBug('found food so about to eat it!'); MMouse(xc, yc, 2, 2); wait(randomrange(50,150)); ClickMouse2(True); wait(randomrange(400,800)); end else begin MyDeBug('no food! runnnnn'); GetMeOutOfHere; end; gametab(tab_stats); end; end;![]()
Like this ?
procedure EattheFood;
begin
HpPercenttoEat := round(55 * (PercenttoEat/100));
if(EatFood = 1) then
begin
repeat
if(CountColorTolerance(65280, 224, 80, 294, 150, 1) < HpPercenttoEat) then
begin
writeln(FloatToStr(CountColorTolerance(65280, 224, 114, 294, 150, 1)));
DrawCustomPaint('Eating', IntToStr(competitionsplayedcount), FloatToStr(expgained), IntToStr(ticketsgained), IntToStr(ctw), TimeRunning, FloatToStr(expperhour));
writeln('Your Hp is below ' + IntToStr(PercenttoEat) + ' percent! Looking for food...');
Open_Inv_Tab;
wait(randomrange(500,1450));
if P07_FindObjEx(x, y, ['at', FoodName], [FoodColor1, FoodColor2], 5, 50, MIX1, MIY1, MIX2, MIY2) then
begin
writeln('Food found! Eating food...');
MMouse(x,y,2,2);
wait(randomrange(50,150));
ClickMouse2(mouse_left);
wait(randomrange(100,450));
end
else
begin
DrawCustomPaint('Food not found!', IntToStr(competitionsplayedcount), FloatToStr(expgained), IntToStr(ticketsgained), IntToStr(ctw), TimeRunning, FloatToStr(expperhour));
writeln('Food not found!');
FoodnotFound := FoodnotFound + 1;
Exit;
end;
end
else
Exit;
until(CountColorTolerance(65280, 224, 80, 294, 150, 1) > HpPercenttoEat);
end;
if(EatFood = 0) then
Exit;
end;
...
There are currently 1 users browsing this thread. (0 members and 1 guests)