PDA

View Full Version : MouseOffClient help



Gunner
05-05-2014, 03:49 AM
Fellas, I'm struggling with the implementation of MouseOffClient. So far I have 2 antiban procedures I'm using within my script.

In my herblore script, I have a main antiban that I call a case random for while potions are mixing, that one (MouseOffClient) I think seems to work fine. However I've written another "mini" antiban for when the production screen is open before clicking "Mix". I'm using MouseOffClient and mainScreen.setAngle in that one. The setAngle works fine, but the MouseOff is funky.

When called it moves the mouse off the client and then immediately comes right back, every single time. I've looked through the antiban.simba include, and it explains what MouseOff does, but it doesn't say (clearly enough for this noob to understand it) what the integer does. I'm using the same integer (4) as in my main antiban, but it doesn't act the same.

I want the mouse to hang off the client for a greater period of time when called. It would be ok to immediately return once in a while, but not every time.

Here is my main antiban:


procedure Antiban; //stolen code - Thx Ashaman & C0h3n
begin
case Random(60) of
10: MouseOffClient(Random(4));
20: HoverSkill(Skill_Herblore);
30: PickUpMouse;
40: MouseOffClient(Random(4));
50: BoredHuman;
59: SleepAndMoveMouse(Random(100));
end;
end;


And here is my "mini" antiban: (btw, I know how silly a Random (3) is. While testing I want to call an antiban everytime)


procedure productionAntiban;

begin
case Random(3) of
1: MouseOffClient(Random(4));
2: mainScreen.setAngle(MS_ANGLE_HIGH);
end;
end;


And here is where the mini is implemented: (the main is implemented in my main loop)


procedure mixIngredients;
var
produceTimer : TTimeMarker;

begin

produceTimer.reset;
produceTimer.start;

repeat
If not Productionscreen.IsOpen Then
Wait(GaussRangeInt(150, 250));
until (produceTimer.getTime() > 10000) or (Productionscreen.IsOpen);

if Productionscreen.IsOpen then
begin
Wait(GaussRangeInt(150, 250));
productionAntiban;
productionscreen.clickStart;
exit;
end;

if not Productionscreen.IsOpen then
begin
WriteLn('Production screen wont open, takin a break!');
Players[CurrentPlayer].Logout;
TerminateScript;
end;
end;


Since I've written the mini antiban, I haven't been able to verify that my main antiban DOES in fact work properly, so I may just be crazy. But the MouseOff that I'm using was lifted directly from Ashaman's herb script, and I know it hangs off for a while.

Any help is greatly appreciated. Thanks is advance.

The Mayor
05-05-2014, 04:38 AM
Well you need to tell it to wait. You'll see in the mouseOffClient it just moves the mouse, and ends.


begin
writeLn('Pretending to look at another website');
mouseOffClient(OFF_CLIENT_RANDOM);
wait(randomRange(5000, 25000));
end;

Gunner
05-05-2014, 04:44 AM
Well you need to tell it to wait. You'll see in the mouseOffClient is just moves the mouse.


begin
writeLn('Pretending to looking at another website');
mouseOffClient(OFF_CLIENT_RANDOM);
wait(randomRange(5000, 25000));
end;


How do I do that from within the case/of code? Or do I need to write a separate procedure for mouseoff and call that procedure in the case/of?

The Mayor
05-05-2014, 04:46 AM
How do I do that from within the case/of code? Or do I need to write a separate procedure for mouseoff and call that procedure in the case/of?

You can put a begin..end in each case


procedure productionAntiban;

begin
case Random(3) of
1: begin
MouseOffClient(Random(4));
wait(randomRange(5000, 25000));
end;
2: mainScreen.setAngle(MS_ANGLE_HIGH);
end;
end;


You can learn a lot from reading through other scripts!

Gunner
05-05-2014, 04:56 AM
You can put a begin..end in each case


procedure productionAntiban;

begin
case Random(3) of
1: begin
MouseOffClient(Random(4));
wait(randomRange(5000, 25000));
end;
2: mainScreen.setAngle(MS_ANGLE_HIGH);
end;
end;



Awesome!



You can learn a lot from reading through other scripts!

Why would I do that when I can make myself look like an utter tool on the forums? :duh: Looking through Ashaman's herb script, his is written the way you suggested. I stole the antiban block from C0h3n's tut and just added the mouseOff from Ashaman's script but didn't pay near enough attention to how it was actually written.

Thanks a lot for your help man!