victordono
2014-11-01 20:49:17
Yeah, as subject says, need it for the production screens with like " smelt" or that herblore production screen, or is pressing space all the time not human-like
2014-11-01 20:49:17
2014-11-01 20:52:13
productionScreen.clickStart()
2014-11-01 20:54:27
From: BMWxi
productionScreen.clickStart()
typeByte(VK_SPACE);
2014-11-01 20:57:19
From: KeepBotting
That'll do the trick if you want to click the button. To press the spacebar, you can dotypeByte(VK_SPACE);
productionScreen.clickStart(false);
(*
TRSProductionScreen.clickStart
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: pascal
function TRSProductionScreen.clickStart(): boolean;
Attempts to click the blue "start" button, returns if succesfull or not.
.. note::
- by Olly
- Last Updated: 06 November 2013 by Olly
Example:
.. code-block:: pascal
if (productionScreen.clickStart()) then
writeln('We started making something!');
*)
function TRSProductionScreen.clickStart(space: boolean = true): boolean;
var
b: TBox;
timeOut: LongWord;
begin
result := false;
b := [self.x1 +252, self.y2 -30, self.x2 -29, self.y2 -3];
// try Space key first
if space then
begin
timeOut := (getSystemTime() + randomRange(1500, 1900));
repeat
multiType(VK_SPACE, randomRange(30, 50), 3);
wait(100 + random(50));
result := (not self.isOpen());
until((getSystemTime() > timeOut) or result);
if (result) then
exit();
end;
// click the button as a failsafe
mouseBox([self.x1 +252, self.y2 -30, self.x2 -29, self.y2 -3], MOUSE_MOVE);
// this is a failsafe in case the productionscreen closes (from the space key) while moving the mouse
if (self.isOpen()) then
begin
fastClick(MOUSE_LEFT);
wait(50 + random(50));
end else
exit(true);
// wait for the productionscreen to close
timeOut := (getSystemTime() + randomRange(5000, 6000));
while (timeOut > getSystemTime()) do
begin
if (not self.isOpen()) then
begin
result := true;
break;
end;
wait(50 + random(50));
end;
print('TRSProductionScreen.clickStart(): result = '+boolToStr(result), TDebug.SUB);
end;
2014-11-01 20:58:44
From: BMWxi
Unless you use
productionScreen.clickStart(false);
It will default to using the spacebar.
2014-11-01 21:17:40
program CorruptOre;
{$DEFINE SMART}
{$I SRL-6/SRL.Simba}
{$i srl-6/lib/misc/srlplayerform.simba}
var
Timer : TTimeMarker;
x : Boolean;
function clickFurnace(): Boolean;
var
x, y: integer;
point: TPoint;
begin
Result := false;
case random(100) of
0..70 :
begin
if(mainscreen.findObject(x, y,8436223, 14, ['Furnace'], MOUSE_LEFT)) then
Result := true;
end;
71..95 :
begin
if(mainscreen.findObject(x, y, 8436223, 14, ['Furnace'], MOUSE_RIGHT)) then begin
Wait(GaussRangeInt(100,500));
chooseOption.select(['Smelt']);
Result := true;
end;
end;
96..100 :
begin
if(mainscreen.findObject(x, y, 8436223, 14, ['Furnace'], MOUSE_NONE)) then
begin
point.create(x, y);
if(gaussRangeInt(-10,10) <= mouseSpeed - 20) then
begin
missMouse(point, false);
fastClick(mouse_Left);
end
else
begin
missMouse(point, true);
fastClick(mouse_Left);
result := true;
end;
end;
end;
end;
Wait(gaussRangeInt(100,2000));
end;
procedure AntiBan();
begin
case random(20000) of
0..25 :
begin
hoverSkill(Skill_Mining);
Wait(GaussRangeInt(500,1000));
end;
101..105 :
begin
boredHuman(true);
end;
150..160 :
begin
randomGameTab(true);
end;
300..320 :
begin
randomRClickItem();
end;
400..700 :
begin
mouseMovingObject;
end;
900..1200 :
begin
Minimap.setAngle(180 - gaussRangeInt(0,360));
end;
1300..1400 :
begin
//add a bit of AFK
Wait(GaussRangeInt(1000,5000));
end;
1500..1800 :
begin
randomCameraAngle(MS_ANGLE_HIGH);
end;
1900..2200 :
begin
randomCameraAngle(MS_ANGLE_LOW);
end;
2250..2255 :
begin
Wait(gaussRangeInt(10000,120000));
if not Players[currentPlayer].login then
exit;
end;
end;
end;
begin
clearDebug();
setupSRL();
repeat
clickFurnace();
productionScreen.clickStart();
Wait(randomrange(144000, 155000))
Until(x);
Writeln('All players inactive,bye!');
End.
end.
2014-11-01 22:19:17
From: victordono
Thanks ! , i dont really want to want to make a new thread but if anyones dropping into this one still,
ive copied and pasted and rewrote mediocrely together a script ( cause im not that well versed yet in simba )
And im just trying to implement anti-ban
Oh and ill just thank ashaman,arclight,and spartan for there scripts that i tweaked around
-snip-
So yeah if anyone can give me advice on how to implement antiban… i just tried copying arclights to be specific antiban since it seemed to make most since with the tons of mouse off screen but im not sure how to do it
uh oh i dont wanna make a new thread to ask this next question right after making this one already @.@
2014-11-01 22:20:17
From: BMWxi
Now that you have an antiban procedure you need to put it into the mainloop somewhere where it will be called regulary. You could put it between the clicking start and the waiting.
2014-11-01 22:27:47
From: victordono
Mhm agreed i thought of that, but i was hoping to somehow use the antiban during the waiting as its more human like, to like mouse off the screen while we're waiting for the ore to be burnt but i cant figure that out
procedure waitForSmeltingToFinish;
var
TimeWaited: TTimeMarker;
begin
TimeWaited.start();
wait(random(144000));
antiban();
wait(144000 - TimeWaited.getTime() + random(11000));
end;
2014-11-01 22:31:37
2014-11-01 22:40:10
From: victordono
Ohh, i see, is there anywhere i can read up on how that TimeWaited works ?
Also what if i wanted the antiban to be performed earlier like the human act of hitting smelt then alt tabbing so i wud want the anti ban abit earlier on
2014-11-01 22:42:01
From: victordono
Ohh, i see, is there anywhere i can read up on how that TimeWaited works ?
Also what if i wanted the antiban to be performed earlier like the human act of hitting smelt then alt tabbing so i wud want the anti ban abit earlier on
wait(random(144000));
to a lower value.
wait(random(5000));
The script will begin antiban sometime within the first 5 seconds.
2014-11-01 22:44:33
program CorruptOre;
{$DEFINE SMART}
{$I SRL-6/SRL.Simba}
{$i srl-6/lib/misc/srlplayerform.simba}
var
Timer : TTimeMarker;
x : Boolean;
function clickFurnace(): Boolean;
var
x, y: integer;
point: TPoint;
begin
Result := false;
case random(100) of
0..70 :
begin
if(mainscreen.findObject(x, y,8436223, 14, ['Furnace'], MOUSE_LEFT)) then
Result := true;
end;
71..95 :
begin
if(mainscreen.findObject(x, y, 8436223, 14, ['Furnace'], MOUSE_RIGHT)) then begin
Wait(GaussRangeInt(100,500));
chooseOption.select(['Smelt']);
Result := true;
end;
end;
96..100 :
begin
if(mainscreen.findObject(x, y, 8436223, 14, ['Furnace'], MOUSE_NONE)) then
begin
point.create(x, y);
if(gaussRangeInt(-10,10) <= mouseSpeed - 20) then
begin
missMouse(point, false);
fastClick(mouse_Left);
end
else
begin
missMouse(point, true);
fastClick(mouse_Left);
result := true;
end;
end;
end;
end;
Wait(gaussRangeInt(100,2000));
end;
procedure AntiBan();
begin
case random(20000) of
0..25 :
begin
hoverSkill(Skill_Mining);
Wait(GaussRangeInt(500,1000));
end;
101..105 :
begin
boredHuman(true);
end;
150..160 :
begin
randomGameTab(true);
end;
300..320 :
begin
randomRClickItem();
end;
400..700 :
begin
mouseMovingObject;
end;
900..1200 :
begin
Minimap.setAngle(180 - gaussRangeInt(0,360));
end;
1300..1400 :
begin
//add a bit of AFK
Wait(GaussRangeInt(1000,5000));
end;
1500..1800 :
begin
randomCameraAngle(MS_ANGLE_HIGH);
end;
1900..2200 :
begin
randomCameraAngle(MS_ANGLE_LOW);
end;
2250..2255 :
begin
Wait(gaussRangeInt(10000,120000));
if not Players[currentPlayer].login then
exit;
end;
end;
end;
procedure waitForSmeltingToFinish;
var
TimeWaited: TTimeMarker;
begin
TimeWaited.start();
mouseOffClient(OFF_CLIENT_RANDOM);
wait(random(144000));
antiban();
mouseOffClient(OFF_CLIENT_RANDOM);
wait(144000 - TimeWaited.getTime() + random(11000));
end;
begin
clearDebug();
setupSRL();
repeat
clickFurnace();
typeByte(VK_SPACE);
waitForSmeltingToFinish();
Until(x);
Writeln('All players inactive,bye!');
End.
end.
Thank you all :)2014-11-01 22:52:53
400..700 :
begin
mouseMovingObject;
end;
could be shortened to
400..700 : mouseMovingObject;
2014-11-01 23:04:40
From: BMWxi
Yeah it looks fine. Just a tip to save space/typing time though: You don't need to use a begin and end for only 1 line. So things likecould be shortened to
400..700 :
begin
mouseMovingObject;
end;
400..700 : mouseMovingObject;
2014-11-01 23:28:27
From: victordono
Thank you ! and just liek that i've managed to scrape together a corruptore bot :D
idk if you noticed the edit about the mouse off client so ill just ask again and thats a wrap :)
"Also how exactly does mouseOffClient(OFF_CLIENT_RANDOM);
since i see "random" does this trigger randomly at a set time or ?"