Guest User

Untitled

a guest
Jun 2nd, 2018
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.24 KB | None | 0 0
  1. program GlowResourceMiner;
  2. {$DEFINE SMART}
  3. {$DEFINE SRL5}
  4. {$IFDEF SRL5}
  5. {$i srl/srl.simba}
  6. {$ELSE}
  7. {$i srl/srl.scar}
  8. {$ENDIF}
  9. {$i srl/srl/misc/paintsmart.simba}
  10.  
  11. const
  12. Ore = 'iron';
  13. OrePrice = 330;
  14. userName = ''; //Username here. (needed to login)
  15. passWord = ''; //Pass here.
  16. nickName = ''; //3-4 lowercase letters from your username.
  17. bankPin = ''; //Bankpin here.
  18. World = 10;//World you want to login.
  19. LampXpIn = 'Farming';//Skill you want exp in from the genie.
  20.  
  21. var
  22. resourceDTM, oreDTM, AColor, BColor, StartScript, StartXp, OresMined: Integer;
  23.  
  24. procedure DeclarePlayers;
  25. begin
  26. HowManyPlayers := 1;
  27. NumberOfPlayers(HowManyPlayers);
  28. CurrentPlayer := 0;
  29.  
  30. Players[0].Name := userName;
  31. Players[0].Pass := passWord;
  32. Players[0].Nick := nickName;
  33. Players[0].Active := True;
  34. Players[0].Pin := bankPin;
  35. Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];//Random event prices.
  36. end;
  37.  
  38. procedure LoadInfo(Ore: String);
  39. begin
  40. Case (Lowercase(Ore)) of
  41. 'iron', 'iron ore':
  42. begin
  43. AColor := 2964582;
  44. BColor := 3294064;
  45. oreDTM := DTMFromString('mrAAAAHic42BgYKhlYmAoAuISIK4G4nYg7gbiRiAuBeLdjAwMe4D4CBCfBuKjjBCxDUC8DYgNZUUZfG21gSYxYcWsQBIfZiSAYQAAup0LRw==');
  46. end;
  47. end;
  48. end;
  49.  
  50. procedure AntiRandoms;
  51. begin
  52. FindNormalRandoms;
  53. LampSkill := (LampXpIn);
  54. LevelUp;
  55. end;
  56.  
  57. procedure StartUpClient;
  58. begin
  59. Smart_Server := World;
  60. Smart_Members := True;
  61. Smart_Signed := True;
  62. Smart_SuperDetail := False;
  63.  
  64. SetupSRL;
  65. DeclarePlayers;
  66. ActivateClient;
  67. if not LoggedIn then
  68. LoginPlayer;
  69.  
  70. if (StartScript = 0) then
  71. begin
  72. if not IsXPBarOpen then ToggleXPBar(true);
  73. StartXp := GetXPBarTotal;
  74. Inc(StartScript);
  75. end;
  76. end;
  77.  
  78. function AtResource: boolean;
  79. var
  80. x, y: Integer;
  81. begin
  82. resourceDTM := DTMFromString('mbQAAAHicY2VgYOhnYmCYBcSLgLgdiNcDsRUjA4MTEFsCsSEQ+wHx5Pp4hqiIUDD+CFTT2TeTgR+oHx0zYsFgAADo8Aq8');
  83. if Length(GetMiniMapDots('npc')) >= 1 then
  84. if (PercentBlackMM >= 35) then
  85. if (DTMRotated(resourceDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
  86. begin
  87. result := true;
  88. end;
  89. FreeDTM(resourceDTM);
  90. end;
  91.  
  92. function EnterResource: boolean;
  93. begin
  94. if (ClickObject(2175656, 4079680, 25, 25, 5, 'yster', 'nter', false)) then
  95. begin
  96. result := true;
  97. end;
  98. end;
  99.  
  100. function ExitResource: boolean;
  101. begin
  102. if (ClickObject(2175656, 4079680, 25, 25, 5, 'yster', 'xit', false)) then
  103. begin
  104. result := true;
  105. end;
  106. end;
  107.  
  108. Function Mining: Boolean; // thanks to flight explained me this ;D
  109. var
  110. PBox: TBox;
  111. begin
  112. PBox := IntToBox(245, 130, 285, 195);
  113. Result := (AveragePixelShift(PBox, 250, 500) > 400);
  114. end;
  115.  
  116. function MineOre: boolean;
  117. begin
  118. AntiRandoms;
  119. while Mining do
  120. Wait(50+random(100));
  121. if (ClickObject(AColor, BColor, 25, 10, 5, 'ocks', 'ine', true)) then
  122. begin
  123. result := true;
  124. end;
  125. end;
  126.  
  127. function CloseBankX: Boolean;// FRM SRL FOLDER
  128. var
  129. i, Timer: Integer;
  130. begin
  131. Result := False;
  132. if DepositScreen then
  133. begin
  134. Timer := GetTimeRunning + 8000;
  135. repeat
  136. Mouse(434, 42, 5, 5, mouse_left);
  137. for i := 0 to 30 do
  138. begin
  139. if not DepositScreen then
  140. begin
  141. Result:= True;
  142. Break;
  143. end;
  144. Wait(100);
  145. end;
  146. Wait(Random(100));
  147. until (GetTimeRunning > Timer) or Result;
  148. end;
  149. end;
  150.  
  151. procedure Bank;
  152. var
  153. i, x, y: integer;
  154. box, box2: TBox;
  155.  
  156. begin
  157. if not DepositScreen then exit;
  158. if (DepositScreen) then
  159. OresMined := OresMined + CountItemsIn('deposit box', 'dtm', oreDTM, []);
  160. begin
  161. for i := 1 to 28 do
  162. begin
  163. box := DepositItemBox(i);
  164. box2 := IntToBox(92, 29, 396, 54);
  165. if (FindDTM(oreDTM, x, y, box.X1, box.Y1, box.X2, box.Y2)) then
  166. begin
  167. QuickDeposit(SRL_DEPOSIT_ALL);
  168. wait(650 + random(350));
  169. end else
  170. CloseBankX;
  171. end;
  172. end;
  173. end;
  174.  
  175. procedure Report;
  176. var
  177. XpGained, Profit: Integer;
  178. begin
  179. XpGained := GetXPBarTotal - StartXp;
  180. Profit := OresMined * OrePrice;
  181. Writeln('========= GlowResourceMiner ==========');
  182. Writeln('|= Time Running : ' + TimeRunning);
  183. Writeln('|= Xp gained : ' + IntToStr(XpGained));
  184. Writeln('|= Ores mined : ' + IntToStr(OresMined));
  185. Writeln('|= Profit : ' + IntToStr(Profit));
  186. Writeln('===================================================');
  187. end;
  188.  
  189. function ClickObject(col, col2, height, width, tol: integer; uptext, action: String; LeftClick: boolean): boolean;
  190. var
  191. i, x, y, cts: Integer;
  192. tpa: TPointArray;
  193. //tb: TBox;
  194. atpa: T2DPointArray;
  195. pt: TPoint;
  196. begin
  197. cts := GetColorToleranceSpeed;
  198. ColorToleranceSpeed(2);
  199. FindColorsSpiralTolerance(MSCX, MSCY, tpa, col, MSX1, MSY1, MSX2, MSY2, tol);
  200. if Length(tpa) = 0 then FindColorsTolerance(tpa, col2, MSX1, MSY1, MSX2, MSY2, tol);
  201. ColorToleranceSpeed(cts);
  202. atpa := TPAtoATPAEx(tpa, height, width);
  203. SortATPAFrom(atpa, Point(MSCX, MSCY));
  204. for i := 0 to High(atpa) do
  205. begin
  206. pt := MiddleTPA(atpa[i]);
  207. //tb := PointToBox(Point(pt.x + 15, pt.y + 15), Point(pt.x - 15, pt.y - 15));
  208. //SMART_DrawBox(tb);
  209. MMouse(pt.x, pt.y, 4, 4);
  210. wait(300 + random(250));
  211. if (IsUpText(uptext)) then
  212. begin
  213. GetMousePos(x, y);
  214. if (not(LeftClick)) then
  215. begin
  216. Mouse(x, y, 0, 0, False);
  217. wait(500 + random(150));
  218. ChooseOption(action);
  219. if (DidRedClick) then
  220. wait(650 + random(350));
  221. result := true;
  222. Exit;
  223. end else
  224. if (LeftClick) then
  225. begin
  226. Mouse(x, y, 0, 0, true);
  227. if (DidRedClick) then
  228. wait(750 + random(350));
  229. result := true;
  230. Exit;
  231. end;
  232. end;
  233. end;
  234. end;
  235.  
  236. procedure Loop;
  237. begin
  238. AntiRandoms;
  239. if DepositScreen then
  240. begin
  241. Bank;
  242. end;
  243. if not (InvFull) then
  244. begin
  245. if (AtResource) then
  246. begin
  247. ExitResource;
  248. end else
  249. MineOre;
  250. end else
  251. if not (AtResource) then
  252. begin
  253. EnterResource;
  254. end else
  255. ClickObject(6916508, 6581876, 20, 20, 5, 'deposit', 'eposit', false);
  256. end;
  257.  
  258. begin
  259. StartUpClient;
  260. SMART_ClearCanvas;
  261. repeat
  262. AntiRandoms;
  263. SetAngle(SRL_ANGLE_HIGH);
  264. LoadInfo(Ore);
  265. Report;
  266. Loop;
  267. FreeDTM(oreDTM);
  268. until (false);
  269. end.
Add Comment
Please, Sign In to add comment