Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { Humidify Script, made on December 31, 2013 by samerdl. Happy new year
- Updated and posted on January 11, 2014.
- Have a great civilian year.
- **** Instructions ****
- 1) Have the Humidify spell runes: Water staff, Fire & astral runes.
- 2) Make or buy a fishbowl (42 crafting), place it in Inv slot #5.
- 3) Ease up your PC's CPU usage, memory leaks can mess it up.
- 4) Stand at spots with no random events I.E: GWD, PC bank/boat.
- 5) Setup the script and launch.
- **** Topic ****
- http://villavu.com/forum/showthread.php?t=107550&p=1279873#post1279873
- First script in a while
- Thanks for everything SRL
- Hi Hoodz Hi Wilco
- {* *}
- program Humidify;
- {$DEFINE SMART8}
- {$I SRL-OSR/SRL.Simba}
- {$i SRL-OSR\SRL\misc\debug.simba}
- {$i SRL-OSR\SRL\misc\SmartGraphics.simba}
- {$I SRL-OSR/SRL/misc/al_functions.simba}
- {$I SRL-OSR/SRL/core/antirandoms/C_AntiRandoms.simba}
- {$I SRL-OSR/SRL/misc/MiniReflection.simba}
- var
- worldshopped, w, messedup, Cast, timer: integer;
- TimeTillBreak: string;
- const
- Breakhandler = true; // Breaks settings.
- BreakTime1 = 45; // how long to play before breaking.
- BreakTime2 = 120; // ----
- BreakWait1 = 15; // how long to break for.
- BreakWait2 = 30; // -----
- {Fail Safes}
- SpellColor= 9861723; // Humidify Color at the coords: 565,248, change it.
- debugScolor = false; // Debugs the Humidify Spell Color at the start.
- SafeTimer = 25000; // Maximum Fail Safe timer, logs out when it passes.
- AreaCheck = false; // assign a polygon area as 'your area'
- decoords = false; // Debugs your Coords from reflection to debugbox.
- XCord1 = 2920; // coords for the polygon.
- Xcord2 = 2940; // if script isn't inside coords, it will terminate.
- YCord1 = 5340; // a fail safe, can be disabled.
- YCord2 = 5360; // Uses reflection of course.
- RuneCheck = true; // Checks if you've run out of runes.
- HopPlayers= true; // hops worlds if another player appears in the area.
- Dotected = 1; // If More than X white dots, script Hops worlds.
- TermCheck = true; // If errors compile, it allows for termination.
- procedure playerSetup;
- begin
- HowManyPlayers := 1;
- NumberOfPlayers(HowManyPlayers);
- CurrentPlayer := 0;
- Players[0].Name := 'zezima'; //Login name.
- Players[0].Pass := 'iscool'; //Password.
- Players[0].Nick := 'ezim'; //Nickname of the account, 4 letters only.
- Players[0].Active := True;
- end;
- {_______________________ End of set up _______________________________________}
- {Added Green UpText for magic}
- function GetGreenUptext: string;
- var
- WhiteT, BlueT, YellowT, OrangeT, GreenT, FoundText: string;
- begin
- WhiteT := GetTextAtExWrap(8, 8, 80, 21, 0, 5, 1, 14541281, 55, 'UpChars07');
- BlueT := GetTextAtExWrap(35, 8, 150, 21, 0, 5, 1, 13423640, 65, 'UpChars07');
- YellowT := GetTextAtExWrap(35, 8, 150, 21, 0, 5, 1, 1235160, 40, 'UpChars07');
- OrangeT := GetTextAtExWrap(35, 8, 150, 21, 0, 5, 1, 4687583, 53, 'UpChars07');
- GreenT := GetTextAtExWrap(8, 8, 150, 21, 0, 5, 1, 120577, 65, 'UpChars07');
- FoundText := WhiteT + ' ' + BlueT + YellowT + OrangeT + GreenT;
- FoundText := ReplaceWrap(FoundText, '.', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, '/', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, '\', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, ',', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, '*', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, '^', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, '"', '', [rfReplaceAll]);
- Result := FoundText;
- end;
- {minor changes}
- function IsUpTextMultiCustom2(Text: TStringArray): Boolean;
- var
- TheText: string;
- i, n: Integer;
- begin
- TheText := GetGreenUptext;
- n := High(Text);
- for i := 0 to n do
- if (Pos(Text[i], TheText) > 0) then
- begin
- Result := True;
- Exit;
- end;
- end;
- {minor changes}
- function WaitUpTextMulti2(S: TStringArray; Time: Integer): Boolean;
- var
- T: Integer;
- begin
- Result := false;
- T := GetSystemTime + Time;
- while (GetSystemTime < T) do
- begin
- if (IsUpTextMultiCustom2(S)) then
- begin
- Result := True;
- Exit;
- end;
- Wait(20 + Random(20));
- end;
- end;
- procedure StartTime;
- begin
- Timer := GetTimeRunning + RandomRange(BreakTime1 * 60000, BreakTime2 * 60000);
- end;
- {breaking procedure}
- procedure takebreaks;
- var
- T, BreakTimer: integer;
- Times: string;
- begin
- if (Breakhandler = false) then
- exit;
- if (GetTimeRunning >= Timer) then
- begin
- writeln('its time to take a break....');
- BreakTimer := Randomrange(BreakWait1 * 60000, BreakWait2 * 60000);
- Times := (MsToTime(BreakTimer, Time_Formal));
- writeln('Breaking for: ' + Times);
- marktime(t);
- repeat
- wait(400);
- logout;
- if not loggedin then
- break;
- until (not (loggedin));
- if (not (loggedin)) then
- begin
- repeat
- wait(1000);
- if (TimeFromMark(t) >= BreakTimer) then
- break;
- until (TimeFromMark(t) >= BreakTimer);
- if (TimeFromMark(T) >= BreakTimer) then
- begin
- writeln('break time is over, back to the script');
- StartTime;
- exit;
- end;
- end;
- end;
- end;
- {random wait times}
- procedure WaitShortClick;
- begin
- if (not (loggedin)) then
- exit;
- case random(600) of
- 1..450: Wait(RandomRange(100, 150));
- 451..570: Wait(RandomRange(150, 200));
- 571..590: Wait(RandomRange(200, 250));
- 591..600: Wait(RandomRange(250, 400));
- end;
- end;
- procedure WaitShortClick2;
- begin
- if (not (loggedin)) then
- exit;
- case random(600) of
- 1..450: Wait(RandomRange(400, 450));
- 451..570: Wait(RandomRange(450, 500));
- 571..590: Wait(RandomRange(500, 550));
- 591..600: Wait(RandomRange(550, 600));
- end;
- end;
- procedure WaitHumanClick;
- begin
- if (not (loggedin)) then
- exit;
- case random(600) of
- 1..450: Wait(RandomRange(600, 650));
- 451..570: Wait(RandomRange(650, 700));
- 571..590: Wait(RandomRange(700, 750));
- 591..600: Wait(RandomRange(750, 800));
- end;
- end;
- procedure WaitHumanClick2;
- begin
- if (not (loggedin)) then
- exit;
- case random(600) of
- 1..450: Wait(RandomRange(800, 1000));
- 451..570: Wait(RandomRange(1000, 1200));
- 571..590: Wait(RandomRange(1200, 1400));
- 591..600: Wait(RandomRange(1400, 2000));
- end;
- end;
- {makes chat tab selected to ALL, to read text properly}
- function NotchatTabAll: boolean;
- var
- Monster: TpointArray;
- TmpCts: Integer;
- begin
- if (not (loggedin)) then
- exit;
- tmpCTS := GetColorToleranceSpeed;
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(0.10, 0.34);
- result := FindColorsTolerance(Monster, 4213586, 6, 482, 60, 497, 11);
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- procedure MakeMyChatTabAll;
- begin
- if (not (loggedin)) then
- exit;
- writeln('Our chat Tab is not set to all, making chat tab to all');
- mousebox(12, 485, 45, 497, 1);
- end;
- {prints progress reports}
- procedure ProgressReport;
- var
- Timeleft, XpPerhour, Casts, CastsPH: Integer;
- begin
- if (not (loggedin)) then
- exit;
- ClearDebug;
- FindNonInventoryRandoms();
- findnoninventoryrandoms;
- findcustomrandoms;
- XpPerhour := (3600 * (Cast) / ((GetTimeRunning / 1000)));
- Casts := (Cast) CastsPH := (3600 * (Casts) / ((GetTimeRunning / 1000)));
- timeleft := ((Timer) - (GetTimeRunning));
- TimeTillBreak := (MsToTime(timeleft, Time_Formal));
- WriteLn('* FHumidify v 1.0');
- WriteLn('* Runtime: ' + TimeRunning);
- Writeln('*');
- writeln('* No.Of Casts: ' + IntToStr(Cast) + ' Casts P/H: ' + IntToStr(XpPerhour) + ' Times messed up ' + IntToStr(messedup));
- if (Breakhandler = true) then
- Writeln('* Time till break : ' + (TimeTillBreak));
- end;
- { Moves mouse at Yellow Dots on Mini map, npc dots..}
- function HoverNearbyNpc: boolean;
- var
- I: Tpointarray;
- P: Integer;
- begin
- if (not (loggedin)) then
- exit;
- I := GetMiniMapDots('npc');
- if (length(I) > 0) then
- begin
- SortTPAFrom(i, Point(MMCX, MMCY));
- P := random(length(I)) Mmouse(I[0].x, I[0].y, 3, 3);
- result := true;
- end;
- end;
- {random keyboard movement, antiban}
- procedure Keyboards;
- begin
- case random(5) of
- 0..2:
- begin
- KeyDown(37);
- WaitShortClick KeyUp(37);
- WaitShortClick KeyDown(40);
- WaitShortClick KeyUp(40);
- end;
- 3..4:
- begin
- KeyDown(39);
- WaitShortClick KeyUp(39);
- WaitShortClick KeyDown(38);
- WaitShortClick KeyUp(38);
- end;
- 5:
- begin
- KeyDown(38);
- WaitShortClick KeyUp(38);
- WaitShortClick KeyDown(39);
- WaitShortClick KeyUp(39);
- end;
- end;
- end;
- {antiban procedures, won't always call it}
- procedure Antiban;
- begin
- if (not (loggedin)) then
- exit;
- case random(100) of
- 0..56:
- begin
- end;
- 57..100:
- begin
- case random(150) of
- 10: hoverskill(skill_magic, false);
- 20: BoredHuman;
- 30: MMouseOffClient('top');
- 40: MMouseOffClient('left');
- 50: MMouseOffClient('right');
- 60: MMouseOffClient('bottom');
- 70: SmallRandomMouse;
- 80: RandomAngle(1);
- 90: RandomAngle(2);
- 100: PickUpMouse;
- 110: CompassMovement(10, 70, true);
- 120: HoverNearbyNpc;
- 130: Keyboards;
- 140: MissMouse(250, 250);
- 150: RandomMovement;
- 160: CompassMovement(240, 300, true);
- 170: AdjustMouseSpeed(3, 10, 20);
- 180: RandomFKeys(true);
- 190: RandomTab(true);
- end;
- end;
- end;
- end;
- {Knows when we run out of runes *NOT used anymore*
- function OutofRunesText: boolean;
- begin
- if (not (loggedin)) then
- exit;
- result := FindTextTPA(clBlack, 0, MCX1, MCY1, MCX2, MCY2, TheMagicWord, smallChars07, Nothing);
- end; }
- {Will see if the 'spell' color is still blue in magic TAB}
- function GotRunes: boolean;
- var
- x: integer;
- begin
- if (not (loggedin)) then
- exit;
- if (RuneCheck = false) then
- exit;
- if not GameTab(tab_magic) then
- exit;
- x := GetColor(565, 248) if (debugScolor = true) then
- begin
- writeln('Our Humidify Spell Color is: ' + IntToStr(x));
- writeln('please set DebugSColor to false now');
- terminatescript;
- end;
- if (X = SpellColor) then
- result := true
- end;
- {Terminates the script}
- procedure Termination;
- begin
- if (TermCheck = false) then
- exit;
- if (loggedin) then
- begin
- Writeln('we ran out of runes, or something really went wrong?, terminating script');
- wait(randomrange(3000, 5000));
- repeat
- if (not (loggedin)) then
- break;
- logout;
- waithumanclick;
- if (not (loggedin)) then
- break;
- until (not (loggedin));
- if (not (loggedin)) then
- begin
- terminatescript;
- end;
- end;
- end;
- {detects white dots on minimap, if more than X dots appear, script logs'}
- function PlayersDetected: boolean;
- var
- P: Integer;
- begin
- if (not (loggedin)) then
- exit;
- if (HopPlayers = false) then
- exit;
- P := CountDots('white');
- if (P > Dotected) then
- begin
- writeln('we have more than one player on the map, logging out');
- result := true;
- end;
- end;
- {RandomWorld by Ashaman88, Added changes by Elfffy & Turpintator}
- function RandomWorld2: Integer;
- var
- h: integer;
- begin
- if (loggedin) then
- exit;
- worldarray := [301, 319, 341, 361, 302, 320, 342, 362, 303, 321, 343, 365, 304, 322, 344, 366, 305, 325, 345, 367, 306, 326, 346, 368, 308, 327, 349, 369, 309, 328, 350, 370, 310, 329, 351, 373, 311, 330, 352, 374, 312, 333, 353, 375, 313, 334, 354, 376, 314, 335, 357, 377, 316, 336, 358, 378, 317, 337, 359, 000, 338, 360];
- H := Random(High(WorldArray));
- Result := worldarray[H];
- W := Result;
- end;
- {logs you in}
- procedure loginloop;
- var
- b: integer;
- begin
- if loggedin then
- exit;
- if (not (loggedin)) then
- begin
- if loggedin then
- exit;
- b := W;
- RandomWorld2;
- if B <> W then
- begin
- if (W = 316) or (w = 308) or (w = 325) or (w = 337) then
- begin
- repeat
- wait(400);
- FindNonInventoryRandoms();
- findnoninventoryrandoms;
- findcustomrandoms;
- RandomWorld2;
- if (W <> 316) or (w <> 308) or (w <> 325) or (w <> 337) then
- break;
- until (W <> 316) or (w <> 308) or (w <> 325) or (w <> 337) if B <> W then
- begin
- Changeworld(W);
- inc(worldshopped);
- ProgressReport;
- makecompass('n');
- setangle(0);
- end;
- end;
- end;
- end;
- end;
- {hops worlds}
- procedure HopWorlds;
- begin
- if (HopPlayers = false) then
- exit;
- if (loggedin) then
- begin
- Writeln('We have detected a player nearby, hopping worlds');
- repeat
- if (not (loggedin)) then
- break;
- logout;
- waithumanclick;
- if (not (loggedin)) then
- break;
- until (not (loggedin));
- if (not (loggedin)) then
- begin
- loginloop;
- end;
- end;
- end;
- {Colors for the bowl of water when its full, blue color}
- function BowlWater: boolean;
- var
- TPA: TpointArray;
- begin
- if (not (loggedin)) then
- exit;
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(0.52, 1.09);
- result := FindColorsTolerance(TPA, 8415075, 565, 247, 592, 270, 1);
- ColorToleranceSpeed(1);
- SetColorSpeed2Modifiers(0.02, 0.2);
- end;
- {Used as a Fail Safe if you get stuck outside your safe area somehow}
- function InsideSafeSpot: boolean;
- begin
- if (not (loggedin)) then
- exit;
- result := R_inPolygon([point(xcord1, ycord1), point(Xcord1, ycord2), point(xcord2, ycord2), point(xcord2, ycord2)]);
- if (result = false) then
- begin
- writeln('we are lost!');
- termination;
- end;
- end;
- {clicks the blue bowl}
- procedure Clickbowl;
- begin
- if not loggedin then
- exit;
- if (AreaCheck = true) then
- InsideSafeSpot;
- if WaitUpTextMulti2(['Empty'], 300) then
- begin
- clickmouse2(mouse_left);
- case random(100) of
- 0..50: waithumanclick;
- 50..60: waitshortclick;
- 61..80: waitshortclick2;
- 81..95: waithumanclick2;
- 96.100: antiban;
- end;
- exit;
- end;
- case random(100) of
- 0..50: waitshortclick;
- 50..60: waitshortclick2;
- 61..80: waithumanclick;
- 81..95: waithumanclick2;
- 96.100: antiban;
- end;
- case random(20) of
- 0..16: Mouse(RandomRange(572, 574), RandomRange(251, 253), random(1), random(1), mouse_move);
- 17..18: Mouse(RandomRange(575, 575), RandomRange(260, 262), random(1), random(1), mouse_move);
- 19..20: Mouse(RandomRange(572, 575), RandomRange(255, 270), random(1), random(1), mouse_move);
- end;
- if WaitUpTextMulti2(['Empty'], 300) then
- begin
- clickmouse2(mouse_left);
- case random(100) of
- 0..50: waithumanclick;
- 50..60: waitshortclick;
- 61..80: waitshortclick2;
- 81..95: waithumanclick2;
- 96.100: antiban;
- end;
- end;
- end;
- {clicks at the magic tab}
- procedure clickmagic;
- var
- t: integer;
- begin
- if not loggedin then
- exit;
- if (AreaCheck = true) then
- InsideSafeSpot;
- if BowlWater then
- exit;
- case random(10) of
- 0..8: FTab(tab_magic);
- 9..10: GameTab(tab_magic);
- end;
- case random(100) of
- 0..50: waithumanclick;
- 50..60: waitshortclick;
- 61..80: waitshortclick2;
- 81..95: waithumanclick2;
- 96.100: antiban;
- end;
- if gametab(tab_magic) then
- begin
- if not GotRunes then
- Termination;
- case random(10) of
- 0..8: Mouse(RandomRange(571, 574), RandomRange(251, 253), random(1), random(1), mouse_move);
- 9..10: Mouse(RandomRange(560, 570), RandomRange(247, 260), random(1), random(1), mouse_move);
- end;
- if WaitUpTextMulti2(['Cast Humidify'], 300) then
- begin
- clickmouse2(mouse_left);
- case random(10) of
- 0..8: FTab(tab_Inv);
- 9..10: GameTab(tab_Inv);
- end;
- Inc(cast);
- progressreport;
- marktime(t);
- repeat
- wait(400);
- if not loggedin then
- exit;
- if BowlWater then
- exit;
- if not gametab(tab_inv) then
- gametab(tab_inv);
- until (TimeFromMark(t) >= SafeTimer) or (bowlwater);
- if (TimeFromMark(T) >= SafeTimer) then
- begin
- writeln('something went wrong, the bowl full of water never appeared');
- inc(messedup);
- repeat
- wait(400);
- Logout;
- if not loggedin then
- exit;
- Logout;
- until (not loggedin)
- end;
- end
- else
- begin
- writeln('we messed up, we dont have cast humidify in select, probably a CPU leak issue from client side');
- Mouse(RandomRange(740, 755), RandomRange(290, 330), random(2), random(2), mouse_left);
- inc(messedup);
- case random(100) of
- 0..50: waithumanclick;
- 50..60: waitshortclick;
- 61..80: waitshortclick2;
- 81..95: waithumanclick2;
- 96.100: antiban;
- end;
- end;
- end;
- end;
- {Loop cycle of magic}
- procedure magicloop;
- begin
- if not loggedin then
- exit;
- takebreaks;
- if PlayersDetected then
- HopWorlds;
- if NotchatTabAll then
- MakeMyChatTabAll;
- if (AreaCheck = true) then
- InsideSafeSpot;
- if BowlWater then
- clickbowl;
- if not BowlWater then
- Clickmagic;
- end;
- {Fail safes loop}
- procedure mainloop;
- begin
- if not loggedin then
- exit;
- if loggedin then
- magicloop;
- end;
- {debugs your position using reflection}
- procedure DebugPosition;
- var
- t: integer;
- point1: tpoint;
- begin
- marktime(t);
- repeat
- wait(400);
- Point1 := R_GetTileGlobal;
- writeln(point1);
- FindNonInventoryRandoms();
- findnoninventoryrandoms;
- findcustomrandoms;
- until (TimeFromMark(t) >= SafeTimer);
- end;
- {debugs humidify spell cast color}
- procedure DebuggSColor;
- var
- t: integer;
- begin
- marktime(t);
- repeat
- wait(400);
- GotRunes;
- FindNonInventoryRandoms();
- findnoninventoryrandoms;
- findcustomrandoms;
- until (TimeFromMark(t) >= SafeTimer);
- end;
- {starts up the script}
- procedure startitup;
- begin
- Playersetup;
- SetupSRL;
- ActivateClient;
- SRL_CombatRandoms := False;
- StartTime;
- if (decoords = true) then
- DebugPosition;
- if (debugScolor = true) then
- DebuggSColor;
- end;
- begin
- startitup;
- repeat
- wait(400);
- if loggedin then
- mainloop;
- if not loggedin then
- loginplayer;
- until (false);
- writeln('how did we get here...');
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement