SRL Archive - General Botting Help

I tried for hours :(


SimbaGod

2014-02-22 11:46:26

I literally tried to figure out for hours how to get the bot search for the monk again when it didnt find it. I thought that the if (not(…)) would be ok but omg i need help.

Im using this script (well trying) but if it wants to heal or attack a monk and theres no monk at the time on the screen, it will just freeze there (even when a monk comes back and we can see it in the camera)…

So yea, thanks for helping in advance! I hope you can find a way to get it work as i tried for hours and am not good with this…

program LeDonsMonks;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/misc/SmartGraphics.Simba}

// Thanks to
// Turpinator, Euphemism, Bolshak25, Officer Barbrady, asdfjkl & others on IRC who helped with this.
// Credits to Saikek for the InCombat function
//--------------------------AUTHOR NOTES-------------------------
// Need failsafe for InCombat
// Perhaps a DTM for healthbar detection?
//--------------------------INSTRUCTIONS------------------------
//Find a world where Monks is empty
//Fill in the PLAYER CREDENTIALS, SCRIPTCONFIGURATION & PLAYER INFORMATION fields
//Go
//Babysit, not flawless - randoms not yet supported. See bellow for supported
//features.
//------------------------CURRENT FEATURES-----------------------
//FINDS MONKS AND ATTACKS THEM
//BASIC PROGGY
//ANTI-BAN
//HEALS
//-----------------------------PLANNED---------------------------
//LOOTING
//BURYING BONES
//BETTER PROGGY
//------------------------------SETUP----------------------------

const
VER = 0.21;
//PLAYER CREDENTIALS
PLAYER_USERNAME = '';
PLAYER_PASSWORD = '';
PLAYER_NICK = '';
//SCRIPT CONFIGURATION
HEALAT = 27; //When should we heal?
ENABLELOOT = 0; //Loot items? 1 for yes 0 for no. Should only be used for arrows etc as monks drop nothing.
ENABLEBURYB = 0; //Bury bones? 1 for yes 0 for no
SPEEDMOUSE = 7; //How fast SMART will move the mouse
LOOTITEM1 = 'woe'; //Put here parts of the names of items you want to loot,
LOOTITEM2 = ''; //IE: 'rrow', 'row', for arrow.
LOOTITEM3 = ''; //1 for each LOOTITEM#.
LOOTITEM4 = '';
LOOTITEM5 = '';
LOOTCOLOR = 43432;
TRAININGSKILL = 'strength'; //enter the skill you're training here for Random checking
//COLOR INFORMATION
HPCOLOUR = 65280;
IRONARROWCOLOR = 537173; //COLOR TOLERANCE 0!
BONECOLOR = 11842750; //best with color tolerance 5
MONKCOLOR1 = 3301261;
MONKCOLOR2 = 3301261;
MONKCOLOR3 = 1386813;

var //GLOBAL VARIABLES
MonksKilled:integer;

procedure Proggy(ScriptStatus:String);
var MonksKilledStr: string;
begin
// Cleardebug;
SMART_ClearCanvas;
MonksKilledStr:= 'Monks Killed: ' + IntToStr(MonksKilled);
Smart_DrawBoxEx (false, true, IntToBox (6, 343, 512, 474), 10206672);
SMART_DrawText (340, 342, LoginChars, MonksKilledStr, clTeal);
SMART_DrawText (6, 455, LoginChars, 'Status: ' + ScriptStatus, clTeal);
end;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
Players[0].Name := PLAYER_USERNAME;
Players[0].Pass := PLAYER_PASSWORD;
Players[0].Nick := PLAYER_NICK;
Players[0].Active := True;
end;

procedure SetupCamera;
begin
Proggy('Setting up Camera and enabling Auto Retaliate');
KeyDown(VK_UP);
wait(randomrange(1500, 2500));
KeyUp(VK_UP);
Retaliate(true);
wait(randomrange(300, 500));
MakeCompass('N');
if IsRunOn(false) then
begin
Writeln('Run is on.');
end
else
begin
wait(randomrange(500,700));
mousebox (622, 412, 661, 452, 1);
wait(randomrange(500,700));
mousebox (567, 176, 590, 198, 1);
end;
end;

{---------------------------------FUNCTIONS------------------------------------}

function InCombat: Boolean; //credits to Saikek
var
x, y: Integer;
begin
if (FindColor(x, y, HPCOLOUR, 200, 100, 300, 200)) then
Result := true
else
Result := false
end;


procedure HumanMove; //NOTE TO SELF: IMPLEMENT THIS.
var
x, y: integer;
begin
case random(200) of
0..160: MMouse(RandomRange(X - 5, X + 5), RandomRange(y - 5, y + 5), 0, 0);
161..190: MMouse(RandomRange(X - 7, X + 7), RandomRange(y - 7, y + 7), 0, 0);
191..200: MMouse(RandomRange(X - 10, X + 10), RandomRange(y - 10, y + 10), 0, 0);
end;
end;
//procedure BoredCirlce; //Moves the mouse Around In a Circle
//var
//x, y: integer;
//begin
//
//end;
{---------------------------DO NOT GET BANNED----------------------------------}
procedure AntiBan; //NOOB LOOKING AT MY SCRIPT?
//var //ANTIBAN 101: http://villavu.com/forum/showthread.php?t=74999
//x, y: integer;
begin
Case Random(100) Of
1: begin Proggy('AntiBan: BoredHuman'); Boredhuman; end;
2: begin Proggy('AntiBan: BoredHuman'); PickUpMouse; end;
3: begin Proggy('AntiBan: RandomMovement'); RandomMovement; end;
4: begin Proggy('AntiBan: RandomRClick'); RandomRClick; end;

end;
end;
procedure MiniAntiBan; //WE CALL THIS SPECIFICALLY WHILST WAITING FOR MONKS TO DIE
var //---!!MAKE MORE COMPLEX!!---
x, y: integer;
begin
Case Random(200) of //We mean waiting for our healthbar to disapear
1: begin Proggy('MiniAntiBan - Waiting for monk to die - BoredHuman'); BoredHuman; end;
2: begin Proggy('MiniAntiBan - Waiting for monk to die - RandomRClick'); RandomRClick; end;
3: begin Proggy('MiniAntiBan - Waiting for monk to die - RandomMovement'); RandomMovement; end;
4: begin Proggy('MiniAntiBan - Waiting for monk to die - SmallRandomMouse'); SmallRandomMouse; end;
// 5: begin Proggy('MiniAntiBan - Waiting for monk to die - HoverSkill'); HoverSkill(hitpoint, false); end;
5: begin Proggy('MiniAntiBan - Waiting for monk to die - HoverSkill'); HoverSkill(TRAININGSKILL, false); end;
6: begin Proggy('MiniAntiBan - Waiting for monk to die - Waiting'); wait(randomrange(1000,2000)); end;
7: begin end;
end;
end;

procedure MiniBreak;
begin
Case Random (160) of
1: begin Proggy('MiniBreak - Breaking - 40 to 60 seconds'); MMouseOffClient('rand'); Wait(randomrange(40000,60000)); end;
2: begin Proggy('MiniBreak - Breaking - 30 to 35 seconds'); MMouseOffClient('rand'); Wait(randomrange(30000,35000)); end;
3: begin Proggy('MiniBreak - Breaking - 20 to 29 seconds'); MMouseOffClient('rand'); Wait(randomrange(20000,29000)); end;
4: begin Proggy('MiniBreak - Breaking - 15 to 20 seconds'); MMouseOffClient('rand'); Wait(randomRange(15000,20000)); end;
end;
end;


procedure Heal;
var
hitpoints: integer;
x, y, monkchatbox: integer;
begin
Proggy('Checking Hitpoints');
if (GetSkillInfo(hitpoints, true) < HEALAT) then
begin
Proggy('Healing');
begin
PlaySound('C:/Simba/sound2.wav');
if (not InCombat) then
begin
if (FindObjCustom(x, y, ['Attack', 'ttack', 'onk'], [MONKCOLOR1, MONKCOLOR2, MONKCOLOR3], 3)) then
ClickMouse2(mouse_right);
ChooseOption('alk');
monkchatbox := BitmapFromString(38, 11, 'meJx9VEEOwjAM29N5A6gSgmcg7T' + 'DGjQNoHPok3Hl1TTohRVOapHaSJkvTkqblNL6H4QC53D8QKGnO5Vt' + 'daQ0LApf04+3ZXHOGyzF59Iu0QxejLJRwZOROGpUrXFQwdVIERrl0' + 'UV5XQqVgDBaHgpzHl+Mrjb6NgVGwoaK+4Q7l+V8fmUcqCsNF2mVRz' + '3ctbhe4RAk7vhBAXVq0dkmzFHL2woPdwft6PVufVTGG4JDqLqPPJN' + '7OB96DS13dO/bBHIC+1c6IZWFp3lK+EbvH+K2ThKrVNeQ5hzH7UyP' + 'XU3vHABw5qyBiGqxRCfST4NsqOtwSgk9L+v2xeIZMvm30nDfqylL6' + 's74pw0jRXrlO14ZgkbSE9fkC7/HkKQ==');
repeat
begin
wait(randomrange(100, 300));
end;
until (FindBitmapToleranceIn(monkchatbox, x, y, 282, 362, 333, 383, 10));
mousebox(232, 443, 359, 459, 1);
wait(randomrange(300, 700));
mousebox(156, 387, 361, 400, 1);
wait(randomrange(300, 700));
mousebox(232, 443, 359, 459, 1);
wait(randomrange(300, 700));
mousebox(232, 443, 359, 459, 1);
end
else
begin
Writeln('We need to heal but we are in combat! waiting..');
repeat
wait(randomrange(1000, 3000));
until(not InCombat)
begin
if (FindObjCustom(x, y, ['Attack', 'ttack', 'onk'], [MONKCOLOR1, MONKCOLOR2, MONKCOLOR3], 10)) then
ClickMouse2(mouse_right);
ChooseOption('alk');
monkchatbox := BitmapFromString(38, 11, 'meJx9VEEOwjAM29N5A6gSgmcg7T' + 'DGjQNoHPok3Hl1TTohRVOapHaSJkvTkqblNL6H4QC53D8QKGnO5Vt' + 'daQ0LApf04+3ZXHOGyzF59Iu0QxejLJRwZOROGpUrXFQwdVIERrl0' + 'UV5XQqVgDBaHgpzHl+Mrjb6NgVGwoaK+4Q7l+V8fmUcqCsNF2mVRz' + '3ctbhe4RAk7vhBAXVq0dkmzFHL2woPdwft6PVufVTGG4JDqLqPPJN' + '7OB96DS13dO/bBHIC+1c6IZWFp3lK+EbvH+K2ThKrVNeQ5hzH7UyP' + 'XU3vHABw5qyBiGqxRCfST4NsqOtwSgk9L+v2xeIZMvm30nDfqylL6' + 's74pw0jRXrlO14ZgkbSE9fkC7/HkKQ==');
repeat
begin
wait(randomrange(100, 300));
end;
until (FindBitmapToleranceIn(monkchatbox, x, y, 282, 362, 333, 383, 10));
mousebox(232, 443, 359, 459, 1);
wait(randomrange(300, 700));
mousebox(156, 387, 361, 400, 1);
wait(randomrange(300, 700));
mousebox(232, 443, 359, 459, 1);
wait(randomrange(300, 700));
mousebox(232, 443, 359, 459, 1);
end;
end;
end;
end
else
begin
Writeln('Hp is fine');
end;
end;

procedure Loot; //basic
var //NEEDS TPA
x, y, BonesDTM: integer;
LootItemsStr: string;
begin
Proggy('Looting');
if (ENABLEBURYB = 1) then //BONES
begin
BonesDTM := DTMFromString('m6wAAAHicjcw7CoBADEXRiKBiRp0PIkzj/jc0jYvRC5PCMoHziuQRFZGCjA0zdty2j7jsVqEYrbdaN+DAiQkJC57WyMHlJb18H7vffMzdDuA=');
Writeln('Burying bones is enabled');
begin
if (FindObjCustom(x, y, ['Take', 'ake', 'bones', 'ones'], [BONECOLOR], 5)) then
begin
MMouse(x, y, 3, 3);
ClickMouse2(mouse_right);
wait(randomrange(300,400));
ChooseOptionMulti(['ones', 'one']);
wait(randomrange(400,600));
MouseBox(628, 173, 655, 197, 1);
if FindDTM(BonesDTM, x, y, 552, 208, 735, 466) then
repeat
begin
MMouse(x, y, 3, 3);
ClickMouse2(mouse_left);
end;
until (not FindDTM(BonesDTM, x, y, 552, 208, 735, 466))
end
end;
end
else
begin
Writeln('Burying bones is not enabled');
end;
if (ENABLELOOT = 1) then //OTHER STUFF
begin
if (ENABLEBURYB = 1) then
begin
Writeln('Burying bones is enabled. We should already have looted them.');
Writeln('Our loot should be bellow us.');
while (IsMoving) do wait(500);
repeat
MouseBox(241, 180, 258, 194, Mouse_Move);
SMART_DrawBox(intToBox( 241, 180, 258, 194));
if IsUpTextMultiCustom(['ake', 'ke', 'Take']) then
begin
ClickMouse2(Mouse_Right);
ChooseOptionMulti([LOOTITEM1, LOOTITEM2, LOOTITEM3, LOOTITEM4, LOOTITEM5]);
end
else
begin
Writeln('Cannot find loot bellow us, we bugggd or your loot is enabled when it should not be.');
end;
until not IsUpTextMultiCustom(['ake', 'ke', 'Take', LOOTITEM1, LOOTITEM2, LOOTITEM3, LOOTITEM4, LOOTITEM5]);
end;
LootItemsStr:= 'Looting is enabled! Looting: ' + (LOOTITEM1) + (LOOTITEM2) + (LOOTITEM3) + (LOOTITEM4) + (LOOTITEM5);
Writeln(LootItemsStr);
if (FindObjCustom(x, y, ['Take', 'ake', 'bones', 'ones'], [BONECOLOR, LOOTCOLOR], 5)) then
begin
repeat
MMouse(x, y, 3, 3);
Clickmouse2(mouse_right);
wait(randomrange(200,300));
ChooseOptionMulti([LOOTITEM1, LOOTITEM2, LOOTITEM3, LOOTITEM4, LOOTITEM5]);
until not IsUpTextMultiCustom([LOOTITEM1, LOOTITEM2, LOOTITEM3, LOOTITEM4, LOOTITEM5]);
end;
end
else
begin
WriteLn('Looting not enabled!');
end;
end;


procedure AttackMonk;
var
starttime, x, y: integer;
begin
starttime := getsystemtime;
if (not InCombat) then
Writeln('Attacking Monk!');
repeat
Proggy('Attacking Monk');
wait(randomrange(1000,1400));
if (FindObjCustom(x, y, ['Attack', 'ttack', 'onk'], [MONKCOLOR1, MONKCOLOR2, MONKCOLOR3], 3)) then
begin
Writeln('Found monk. Clicking.');
MMouse(x, y, 3, 3);
ClickMouse2(mouse_left);
if DidYellowClick then
begin
repeat
Writeln('Misclicked monk - Trying again!');
if (FindObjCustom(x, y, ['Attack', 'ttack', 'onk'], [MONKCOLOR1, MONKCOLOR2, MONKCOLOR3], 10)) then
begin
Writeln('Found monk. Clicking.');
MMouse(x, y, 3, 3);
ClickMouse2(mouse_left);
end;
until(not DidYellowClick);
end;
end
else
begin
Writeln('Did not find monk. Random chance of moving Camera.');
case random(20) of
1: begin KeyDown(VK_LEFT); wait(randomrange(1000,1500)); KeyUp(VK_LEFT); end;
2: begin KeyDown(VK_RIGHT); wait(randomrange(1000,1500)); KeyUp(VK_RIGHT); end;
end;
end;
until (InCombat) or (getsystemtime - starttime > (randomrange(20000, 25000)));
while (InCombat) do begin Wait(1000); MiniAntiBan; end; //CALLS MiniAntiBan whilst InCombat is true
MonksKilled := MonksKilled +1
Writeln('We probably killed a monk.');
end;

begin
MouseSpeed := SPEEDMOUSE;
DeclarePlayers;
SetupSRL;
ActivateClient;
Wait(2000);
LoginPlayer;
SetupCamera;
repeat
if (not loggedin) then
begin
loginplayer;
setupcamera;
end;
if loggedin then
begin
AttackMonk;
Loot;
AntiBan;
MiniBreak;
Heal;
end;
until(false)
end.

like in heal; in this line : if (FindObjCustom(x, y, ['Attack', 'ttack', 'onk'], [MONKCOLOR1, MONKCOLOR2, MONKCOLOR3], 3)) then

what if it doesnt find it? I want the bot to continue searching :/

Frement

2014-02-22 12:04:46

You need a loop, but make sure to add a break in case it doesn't find the monk in X tries. while (not MonkFound)) do begin ..findmonketc… end;

SimbaGod

2014-02-22 12:08:52

From: Frement
You need a loop, but make sure to add a break in case it doesn't find the monk in X tries. while (not MonkFound)) do begin ..findmonketc… end;


not really sure how to do this tbh :/ im kind of new in coding and in this script, i tried what i thought whould work but i didnt try that as i dont know how :S where to put the code and what is it… :/ sry for that xD just trying to learn and use this script

Frement

2014-02-22 12:39:09

From: SimbaGod
not really sure how to do this tbh :/ im kind of new in coding and in this script, i tried what i thought whould work but i didnt try that as i dont know how :S where to put the code and what is it… :/ sry for that xD just trying to learn and use this script


Like this:
while (not MonkFound) do begin
if (FindColors(..your monk finding stuff here) then
begin
...
...
...
MonkFound := True; //We found the monk, and most likely killed it or whatever, mark as found
end;
Inc(MonkFindTries);
if (MonkFindTries > 5) then
break; //We havent found a monk in 5 tries, lets break the loop
end;

rj

2014-02-22 13:59:29

You should make a function that will determine whether or not it found the monk instead of having it in the heal procedure, and also having a procedure dedicated to fighting the monk like so

function findMonk():boolean;
begin
result := (FindObjCustom(x, y, ['Attack', 'ttack', 'onk'], [MONKCOLOR1, MONKCOLOR2, MONKCOLOR3], 3));
end;

procedure fight;
var
t:integer;
begin
if (failsafe > 40) then // if failed more then 40 times, end the script and logout
begin
Writeln('The script failed more then 40 times, logging out');
logout;
terminateScript;
end;
if (findMonk()) then
begin
failsafe := 0; // set fails to 0
if waitFunc(@inCombat, 40, 5000) then // wait to be in combat for 5 seconds
begin
markTime(t); // stores the current system time into t
while (inCombat) do // while in combat do the following
begin
findNormalRandoms; // find randoms
if (timeFromMark(t) > 15000) then // if been in combat for more then 15 seconds then exit
break;
if (not inCombat) then // if not in combat then exit
begin
killed := killed + 1;
break;
end else // if still in combat then do the healing procedure and antiban
antiBan;
end;
end else // if did not get into combat after attacking the monk then add to the failsafe var
begin
writeln('Did not end up in combat after attacking a monk');
failsafe := failsafe + 1;
wait(random(500));
end;
end else // if did not find the monk, wait, waits more each time it fails
begin
failsafe := failsafe + 1;
writeln('Did not find monk, waiting');
wait((failsafe * random(100)) + random(200));
end;
end;

Sjoe

2014-02-22 14:17:50

From: Officer Barbrady
You should make a function that will determine whether or not it found the monk instead of having it in the heal procedure, and also having a procedure dedicated to fighting the monk like so


not sure why u only make it 'heal' during combat.

And for this particular script, the monks heals u if you talk to them. (iirc)

rj

2014-02-22 14:37:18

From: Sjoe
not sure why u only make it 'heal' during combat.

And for this particular script, the monks heals u if you talk to them. (iirc)


O

Then heal can be taken out lol it's not like I'm writing the script for him

SimbaGod

2014-02-22 17:10:01

Still really confused hot to do this. Tried to add up some of the things u guys said but Im so bad in this holy shit XD its been 1h :/ Any tips again? :P Thanks guys

Sjoe

2014-02-22 17:25:20

From: SimbaGod
Still really confused hot to do this. Tried to add up some of the things u guys said but Im so bad in this holy shit XD its been 1h :/ Any tips again? :P Thanks guys


Takes few days to learn to script :) Just check the tutorial section out.

SimbaGod

2014-02-23 01:44:52

Thanks for your help! I really appreciate it!

However I cant get it work :/

I did this :
function MonkFound: Boolean; 
var
x, y: Integer;
begin
if (FindColors(x, y, MONKCOLOR1, MONKCOLOR2, MONKCOLOR3)) then
Result := true
else
Result := false
end;

So it knows what its true/false and knows whats the "MonkFound" but it doesnt seem to work out:
[PHP]Type mismatch at line 117
Compiling failed.[/PHP]

Also, did i put the while … in the good place? I replaced a part of the heal; for the thing you said :
 while (not MonkFound) do begin
if (FindColors(MONKCOLOR1, MONKCOLOR2, MONKCOLOR3) then
begin
ClickMouse2(mouse_right);
ChooseOption('alk');
monkchatbox := BitmapFromString(38, 11, 'meJx9VEEOwjAM29N5A6gSgmcg7T' + 'DGjQNoHPok3Hl1TTohRVOapHaSJkvTkqblNL6H4QC53D8QKGnO5Vt' + 'daQ0LApf04+3ZXHOGyzF59Iu0QxejLJRwZOROGpUrXFQwdVIERrl0' + 'UV5XQqVgDBaHgpzHl+Mrjb6NgVGwoaK+4Q7l+V8fmUcqCsNF2mVRz' + '3ctbhe4RAk7vhBAXVq0dkmzFHL2woPdwft6PVufVTGG4JDqLqPPJN' + '7OB96DS13dO/bBHIC+1c6IZWFp3lK+EbvH+K2ThKrVNeQ5hzH7UyP' + 'XU3vHABw5qyBiGqxRCfST4NsqOtwSgk9L+v2xeIZMvm30nDfqylL6' + 's74pw0jRXrlO14ZgkbSE9fkC7/HkKQ==');
repeat
begin
wait(randomrange(100, 300));
end;
until (FindBitmapToleranceIn(monkchatbox, x, y, 282, 362, 333, 383, 10));
mousebox(232, 443, 359, 459, 1);
wait(randomrange(300, 700));
mousebox(156, 387, 361, 400, 1);
wait(randomrange(300, 700));
mousebox(232, 443, 359, 459, 1);
wait(randomrange(300, 700));
mousebox(232, 443, 359, 459, 1);
MonkFound := True; //We found the monk, and most likely killed it or whatever, mark as found
end;
Inc(MonkFindTries);
if (MonkFindTries > 10) then
break; //We havent found a monk in 5 tries, lets break the loop
end;


idk if im in a good start or not to fix this.

Sry maybe it looks super simple for you guys but its actually a pain in the ass for me xD im really trying :p

Any other tips? What did i do wrong?

THANKS AGAIN!

program LeDonsMonks;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/misc/SmartGraphics.Simba}

// Thanks to
// Turpinator, Euphemism, Bolshak25, Officer Barbrady, asdfjkl & others on IRC who helped with this.
// Credits to Saikek for the InCombat function
//--------------------------AUTHOR NOTES-------------------------
// Need failsafe for InCombat
// Perhaps a DTM for healthbar detection?
//--------------------------INSTRUCTIONS------------------------
//Find a world where Monks is empty
//Fill in the PLAYER CREDENTIALS, SCRIPTCONFIGURATION & PLAYER INFORMATION fields
//Go
//Babysit, not flawless - randoms not yet supported. See bellow for supported
//features.
//------------------------CURRENT FEATURES-----------------------
//FINDS MONKS AND ATTACKS THEM
//BASIC PROGGY
//ANTI-BAN
//HEALS
//-----------------------------PLANNED---------------------------
//LOOTING
//BURYING BONES
//BETTER PROGGY
//------------------------------SETUP----------------------------

const
VER = 0.21;
//PLAYER CREDENTIALS
PLAYER_USERNAME = '';
PLAYER_PASSWORD = '';
PLAYER_NICK = '';
//SCRIPT CONFIGURATION
HEALAT = 27; //When should we heal?
ENABLELOOT = 0; //Loot items? 1 for yes 0 for no. Should only be used for arrows etc as monks drop nothing.
ENABLEBURYB = 0; //Bury bones? 1 for yes 0 for no
SPEEDMOUSE = 7; //How fast SMART will move the mouse
LOOTITEM1 = 'woe'; //Put here parts of the names of items you want to loot,
LOOTITEM2 = ''; //IE: 'rrow', 'row', for arrow.
LOOTITEM3 = ''; //1 for each LOOTITEM#.
LOOTITEM4 = '';
LOOTITEM5 = '';
LOOTCOLOR = 43432;
TRAININGSKILL = 'strength'; //enter the skill you're training here for Random checking
//COLOR INFORMATION
HPCOLOUR = 65280;
IRONARROWCOLOR = 537173; //COLOR TOLERANCE 0!
BONECOLOR = 11842750; //best with color tolerance 5
MONKCOLOR1 = 3301261;
MONKCOLOR2 = 3301261;
MONKCOLOR3 = 1386813;

var //GLOBAL VARIABLES
MonksKilled:integer;

procedure Proggy(ScriptStatus:String);
var MonksKilledStr: string;
begin
// Cleardebug;
SMART_ClearCanvas;
MonksKilledStr:= 'Monks Killed: ' + IntToStr(MonksKilled);
Smart_DrawBoxEx (false, true, IntToBox (6, 343, 512, 474), 10206672);
SMART_DrawText (340, 342, LoginChars, MonksKilledStr, clTeal);
SMART_DrawText (6, 455, LoginChars, 'Status: ' + ScriptStatus, clTeal);
end;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
Players[0].Name := PLAYER_USERNAME;
Players[0].Pass := PLAYER_PASSWORD;
Players[0].Nick := PLAYER_NICK;
Players[0].Active := True;
end;

procedure SetupCamera;
begin
Proggy('Setting up Camera and enabling Auto Retaliate');
KeyDown(VK_UP);
wait(randomrange(1500, 2500));
KeyUp(VK_UP);
Retaliate(true);
wait(randomrange(300, 500));
MakeCompass('N');
if IsRunOn(false) then
begin
Writeln('Run is on.');
end
else
begin
wait(randomrange(500,700));
mousebox (622, 412, 661, 452, 1);
wait(randomrange(500,700));
mousebox (567, 176, 590, 198, 1);
end;
end;

{---------------------------------FUNCTIONS------------------------------------}

function InCombat: Boolean; //credits to Saikek
var
x, y: Integer;
begin
if (FindColor(x, y, HPCOLOUR, 200, 100, 300, 200)) then
Result := true
else
Result := false
end;
function MonkFound: Boolean;
var
x, y: Integer;
begin
if (FindColors(x, y, MONKCOLOR1, MONKCOLOR2, MONKCOLOR3)) then
Result := true
else
Result := false
end;
procedure HumanMove; //NOTE TO SELF: IMPLEMENT THIS.
var
x, y: integer;
begin
case random(200) of
0..160: MMouse(RandomRange(X - 5, X + 5), RandomRange(y - 5, y + 5), 0, 0);
161..190: MMouse(RandomRange(X - 7, X + 7), RandomRange(y - 7, y + 7), 0, 0);
191..200: MMouse(RandomRange(X - 10, X + 10), RandomRange(y - 10, y + 10), 0, 0);
end;
end;
//procedure BoredCirlce; //Moves the mouse Around In a Circle
//var
//x, y: integer;
//begin
//
//end;
{---------------------------DO NOT GET BANNED----------------------------------}
procedure AntiBan; //NOOB LOOKING AT MY SCRIPT?
//var //ANTIBAN 101: http://villavu.com/forum/showthread.php?t=74999
//x, y: integer;
begin
Case Random(100) Of
1: begin Proggy('AntiBan: BoredHuman'); Boredhuman; end;
2: begin Proggy('AntiBan: BoredHuman'); PickUpMouse; end;
3: begin Proggy('AntiBan: RandomMovement'); RandomMovement; end;
4: begin Proggy('AntiBan: RandomRClick'); RandomRClick; end;

end;
end;
procedure MiniAntiBan; //WE CALL THIS SPECIFICALLY WHILST WAITING FOR MONKS TO DIE
var //---!!MAKE MORE COMPLEX!!---
x, y: integer;
begin
Case Random(200) of //We mean waiting for our healthbar to disapear
1: begin Proggy('MiniAntiBan - Waiting for monk to die - BoredHuman'); BoredHuman; end;
2: begin Proggy('MiniAntiBan - Waiting for monk to die - RandomRClick'); RandomRClick; end;
3: begin Proggy('MiniAntiBan - Waiting for monk to die - RandomMovement'); RandomMovement; end;
4: begin Proggy('MiniAntiBan - Waiting for monk to die - SmallRandomMouse'); SmallRandomMouse; end;
// 5: begin Proggy('MiniAntiBan - Waiting for monk to die - HoverSkill'); HoverSkill(hitpoint, false); end;
5: begin Proggy('MiniAntiBan - Waiting for monk to die - HoverSkill'); HoverSkill(TRAININGSKILL, false); end;
6: begin Proggy('MiniAntiBan - Waiting for monk to die - Waiting'); wait(randomrange(1000,2000)); end;
7: begin end;
end;
end;

procedure MiniBreak;
begin
Case Random (160) of
1: begin Proggy('MiniBreak - Breaking - 40 to 60 seconds'); MMouseOffClient('rand'); Wait(randomrange(40000,60000)); end;
2: begin Proggy('MiniBreak - Breaking - 30 to 35 seconds'); MMouseOffClient('rand'); Wait(randomrange(30000,35000)); end;
3: begin Proggy('MiniBreak - Breaking - 20 to 29 seconds'); MMouseOffClient('rand'); Wait(randomrange(20000,29000)); end;
4: begin Proggy('MiniBreak - Breaking - 15 to 20 seconds'); MMouseOffClient('rand'); Wait(randomRange(15000,20000)); end;
end;
end;


procedure Heal;
var
hitpoints: integer;
x, y, monkchatbox: integer;
begin
Proggy('Checking Hitpoints');
if (GetSkillInfo(hitpoints, true) < HEALAT) then
begin
Proggy('Healing');
begin
PlaySound('C:/Simba/sound2.wav');
if (not InCombat) then
while (not MonkFound) do begin
if (FindColors(MONKCOLOR1, MONKCOLOR2, MONKCOLOR3) then
begin
ClickMouse2(mouse_right);
ChooseOption('alk');
monkchatbox := BitmapFromString(38, 11, 'meJx9VEEOwjAM29N5A6gSgmcg7T' + 'DGjQNoHPok3Hl1TTohRVOapHaSJkvTkqblNL6H4QC53D8QKGnO5Vt' + 'daQ0LApf04+3ZXHOGyzF59Iu0QxejLJRwZOROGpUrXFQwdVIERrl0' + 'UV5XQqVgDBaHgpzHl+Mrjb6NgVGwoaK+4Q7l+V8fmUcqCsNF2mVRz' + '3ctbhe4RAk7vhBAXVq0dkmzFHL2woPdwft6PVufVTGG4JDqLqPPJN' + '7OB96DS13dO/bBHIC+1c6IZWFp3lK+EbvH+K2ThKrVNeQ5hzH7UyP' + 'XU3vHABw5qyBiGqxRCfST4NsqOtwSgk9L+v2xeIZMvm30nDfqylL6' + 's74pw0jRXrlO14ZgkbSE9fkC7/HkKQ==');
repeat
begin
wait(randomrange(100, 300));
end;
until (FindBitmapToleranceIn(monkchatbox, x, y, 282, 362, 333, 383, 10));
mousebox(232, 443, 359, 459, 1);
wait(randomrange(300, 700));
mousebox(156, 387, 361, 400, 1);
wait(randomrange(300, 700));
mousebox(232, 443, 359, 459, 1);
wait(randomrange(300, 700));
mousebox(232, 443, 359, 459, 1);
MonkFound := True; //We found the monk, and most likely killed it or whatever, mark as found
end;
Inc(MonkFindTries);
if (MonkFindTries > 10) then
break; //We havent found a monk in 5 tries, lets break the loop
end;
else
begin
Writeln('We need to heal but we are in combat! waiting..');
repeat
wait(randomrange(1000, 3000));
until(not InCombat)
begin
if (FindObjCustom(x, y, ['Attack', 'ttack', 'onk'], [MONKCOLOR1, MONKCOLOR2, MONKCOLOR3], 10)) then
ClickMouse2(mouse_right);
ChooseOption('alk');
monkchatbox := BitmapFromString(38, 11, 'meJx9VEEOwjAM29N5A6gSgmcg7T' + 'DGjQNoHPok3Hl1TTohRVOapHaSJkvTkqblNL6H4QC53D8QKGnO5Vt' + 'daQ0LApf04+3ZXHOGyzF59Iu0QxejLJRwZOROGpUrXFQwdVIERrl0' + 'UV5XQqVgDBaHgpzHl+Mrjb6NgVGwoaK+4Q7l+V8fmUcqCsNF2mVRz' + '3ctbhe4RAk7vhBAXVq0dkmzFHL2woPdwft6PVufVTGG4JDqLqPPJN' + '7OB96DS13dO/bBHIC+1c6IZWFp3lK+EbvH+K2ThKrVNeQ5hzH7UyP' + 'XU3vHABw5qyBiGqxRCfST4NsqOtwSgk9L+v2xeIZMvm30nDfqylL6' + 's74pw0jRXrlO14ZgkbSE9fkC7/HkKQ==');
repeat
begin
wait(randomrange(100, 300));
end;
until (FindBitmapToleranceIn(monkchatbox, x, y, 282, 362, 333, 383, 10));
mousebox(232, 443, 359, 459, 1);
wait(randomrange(300, 700));
mousebox(156, 387, 361, 400, 1);
wait(randomrange(300, 700));
mousebox(232, 443, 359, 459, 1);
wait(randomrange(300, 700));
mousebox(232, 443, 359, 459, 1);
end;
end;
end;
end
else
begin
Writeln('Hp is fine');
end;
end;

procedure Loot; //basic
var //NEEDS TPA
x, y, BonesDTM: integer;
LootItemsStr: string;
begin
Proggy('Looting');
if (ENABLEBURYB = 1) then //BONES
begin
BonesDTM := DTMFromString('m6wAAAHicjcw7CoBADEXRiKBiRp0PIkzj/jc0jYvRC5PCMoHziuQRFZGCjA0zdty2j7jsVqEYrbdaN+DAiQkJC57WyMHlJb18H7vffMzdDuA=');
Writeln('Burying bones is enabled');
begin
if (FindObjCustom(x, y, ['Take', 'ake', 'bones', 'ones'], [BONECOLOR], 5)) then
begin
MMouse(x, y, 3, 3);
ClickMouse2(mouse_right);
wait(randomrange(300,400));
ChooseOptionMulti(['ones', 'one']);
wait(randomrange(400,600));
MouseBox(628, 173, 655, 197, 1);
if FindDTM(BonesDTM, x, y, 552, 208, 735, 466) then
repeat
begin
MMouse(x, y, 3, 3);
ClickMouse2(mouse_left);
end;
until (not FindDTM(BonesDTM, x, y, 552, 208, 735, 466))
end
end;
end
else
begin
Writeln('Burying bones is not enabled');
end;
if (ENABLELOOT = 1) then //OTHER STUFF
begin
if (ENABLEBURYB = 1) then
begin
Writeln('Burying bones is enabled. We should already have looted them.');
Writeln('Our loot should be bellow us.');
while (IsMoving) do wait(500);
repeat
MouseBox(241, 180, 258, 194, Mouse_Move);
SMART_DrawBox(intToBox( 241, 180, 258, 194));
if IsUpTextMultiCustom(['ake', 'ke', 'Take']) then
begin
ClickMouse2(Mouse_Right);
ChooseOptionMulti([LOOTITEM1, LOOTITEM2, LOOTITEM3, LOOTITEM4, LOOTITEM5]);
end
else
begin
Writeln('Cannot find loot bellow us, we bugggd or your loot is enabled when it should not be.');
end;
until not IsUpTextMultiCustom(['ake', 'ke', 'Take', LOOTITEM1, LOOTITEM2, LOOTITEM3, LOOTITEM4, LOOTITEM5]);
end;
LootItemsStr:= 'Looting is enabled! Looting: ' + (LOOTITEM1) + (LOOTITEM2) + (LOOTITEM3) + (LOOTITEM4) + (LOOTITEM5);
Writeln(LootItemsStr);
if (FindObjCustom(x, y, ['Take', 'ake', 'bones', 'ones'], [BONECOLOR, LOOTCOLOR], 5)) then
begin
repeat
MMouse(x, y, 3, 3);
Clickmouse2(mouse_right);
wait(randomrange(200,300));
ChooseOptionMulti([LOOTITEM1, LOOTITEM2, LOOTITEM3, LOOTITEM4, LOOTITEM5]);
until not IsUpTextMultiCustom([LOOTITEM1, LOOTITEM2, LOOTITEM3, LOOTITEM4, LOOTITEM5]);
end;
end
else
begin
WriteLn('Looting not enabled!');
end;
end;


procedure AttackMonk;
var
starttime, x, y: integer;
begin
starttime := getsystemtime;
if (not InCombat) then
Writeln('Attacking Monk!');
repeat
Proggy('Attacking Monk');
wait(randomrange(1000,1400));
if (FindObjCustom(x, y, ['Attack', 'ttack', 'onk'], [MONKCOLOR1, MONKCOLOR2, MONKCOLOR3], 3)) then
begin
Writeln('Found monk. Clicking.');
MMouse(x, y, 3, 3);
ClickMouse2(mouse_left);
if DidYellowClick then
begin
repeat
Writeln('Misclicked monk - Trying again!');
if (FindObjCustom(x, y, ['Attack', 'ttack', 'onk'], [MONKCOLOR1, MONKCOLOR2, MONKCOLOR3], 10)) then
begin
Writeln('Found monk. Clicking.');
MMouse(x, y, 3, 3);
ClickMouse2(mouse_left);
end;
until(not DidYellowClick);
end;
end
else
begin
Writeln('Did not find monk. Random chance of moving Camera.');
case random(20) of
1: begin KeyDown(VK_LEFT); wait(randomrange(1000,1500)); KeyUp(VK_LEFT); end;
2: begin KeyDown(VK_RIGHT); wait(randomrange(1000,1500)); KeyUp(VK_RIGHT); end;
end;
end;
until (InCombat) or (getsystemtime - starttime > (randomrange(20000, 25000)));
while (InCombat) do begin Wait(1000); MiniAntiBan; end; //CALLS MiniAntiBan whilst InCombat is true
MonksKilled := MonksKilled +1
Writeln('We probably killed a monk.');
end;

begin
MouseSpeed := SPEEDMOUSE;
DeclarePlayers;
SetupSRL;
ActivateClient;
Wait(2000);
LoginPlayer;
SetupCamera;
repeat
if (not loggedin) then
begin
loginplayer;
setupcamera;
end;
if loggedin then
begin
AttackMonk;
Loot;
AntiBan;
MiniBreak;
Heal;
end;
until(false)
end.

The Mayor

2014-02-23 02:40:32

Well done for attempting to fix an outdated script! It took me 2 weeks to fix my first script ;)

I haven't used SRL5/OSR for about a year so I'm not sure if I can be of any help :(

Your error in your monkFound procedure is because you used the wrong parameters in the findColors function. It is findColors(x, y, color, x1, y1, x2, y2). Basically you forgot the search box (and you can only have 1 color, not 3).

I think it would be better for you to use findObjCustom since you are still learning. Something like:


var
monsterColors: TIntegerArray;
monsterUptexts: TStringArray;

function monkFound(): boolean;
var
x, y: integer;
begin
if findObjCustom(x, y, [monsterUptexts], [monsterColors], 3) then
begin
writeLn('monkFound(): result = true!');
result := true;
end else
begin
writeLn('monkFound(): result = false');
exit; // exit if none found
end;

MMouse(x, y, 3, 3);
ClickMouse2(MOUSE_LEFT); //if found, move and click
end;


begin
monsterColors := [12233445, 132434, 314545]; // filling the arrays with info
monsterUptexts := ['onk', 'Monk', 'Mon'];

repeat
monkFound();
until isInCombat() or // timeout etc..

end.

E: Sorry didn't realise you couldn't declare vars and assign them at the same time with PascalScript.

SimbaGod

2014-02-23 11:34:09

K so first,
procedure HumanMove; //NOTE TO SELF: IMPLEMENT THIS.
var
x, y: integer;
begin
case random(200) of
0..160: MMouse(RandomRange(X - 5, X + 5), RandomRange(y - 5, y + 5), 0, 0);
161..190: MMouse(RandomRange(X - 7, X + 7), RandomRange(y - 7, y + 7), 0, 0);
191..200: MMouse(RandomRange(X - 10, X + 10), RandomRange(y - 10, y + 10), 0, 0);
end;
end;

theres a problem with this and i dont know what to do.

[php]Identifier expected at line 131
Compiling failed.[/php]

2. am I on the right track?

3. Will i have to declare somewhere the "monkfindtries"? and how?
 monkFound := True; //We found the monk, and most likely killed it or whatever, mark as found
end;
Inc(MonkFindTries);
if (MonkFindTries > 10) then
break; //We havent found a monk in 5 tries, lets break the loop
end;

Finally, is there a way to see ALL the errors? :/

GUYS I REALLY APPRECIATE UR HELP! :D

program LeDonsMonks;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/misc/SmartGraphics.Simba}

// Thanks to
// Turpinator, Euphemism, Bolshak25, Officer Barbrady, asdfjkl & others on IRC who helped with this.
// Credits to Saikek for the InCombat function
//--------------------------AUTHOR NOTES-------------------------
// Need failsafe for InCombat
// Perhaps a DTM for healthbar detection?
//--------------------------INSTRUCTIONS------------------------
//Find a world where Monks is empty
//Fill in the PLAYER CREDENTIALS, SCRIPTCONFIGURATION & PLAYER INFORMATION fields
//Go
//Babysit, not flawless - randoms not yet supported. See bellow for supported
//features.
//------------------------CURRENT FEATURES-----------------------
//FINDS MONKS AND ATTACKS THEM
//BASIC PROGGY
//ANTI-BAN
//HEALS
//-----------------------------PLANNED---------------------------
//LOOTING
//BURYING BONES
//BETTER PROGGY
//------------------------------SETUP----------------------------

const
VER = 0.21;
//PLAYER CREDENTIALS
PLAYER_USERNAME = '';
PLAYER_PASSWORD = '';
PLAYER_NICK = '';
//SCRIPT CONFIGURATION
HEALAT = 27; //When should we heal?
ENABLELOOT = 0; //Loot items? 1 for yes 0 for no. Should only be used for arrows etc as monks drop nothing.
ENABLEBURYB = 0; //Bury bones? 1 for yes 0 for no
SPEEDMOUSE = 7; //How fast SMART will move the mouse
LOOTITEM1 = 'woe'; //Put here parts of the names of items you want to loot,
LOOTITEM2 = ''; //IE: 'rrow', 'row', for arrow.
LOOTITEM3 = ''; //1 for each LOOTITEM#.
LOOTITEM4 = '';
LOOTITEM5 = '';
LOOTCOLOR = 43432;
TRAININGSKILL = 'strength'; //enter the skill you're training here for Random checking
//COLOR INFORMATION
HPCOLOUR = 65280;
IRONARROWCOLOR = 537173; //COLOR TOLERANCE 0!
BONECOLOR = 11842750; //best with color tolerance 5
MONKCOLOR1 = 3301261;
MONKCOLOR2 = 3301261;
MONKCOLOR3 = 1386813;

var //GLOBAL VARIABLES
MonksKilled:integer;

procedure Proggy(ScriptStatus:String);
var MonksKilledStr: string;
begin
// Cleardebug;
SMART_ClearCanvas;
MonksKilledStr:= 'Monks Killed: ' + IntToStr(MonksKilled);
Smart_DrawBoxEx (false, true, IntToBox (6, 343, 512, 474), 10206672);
SMART_DrawText (340, 342, LoginChars, MonksKilledStr, clTeal);
SMART_DrawText (6, 455, LoginChars, 'Status: ' + ScriptStatus, clTeal);
end;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
Players[0].Name := PLAYER_USERNAME;
Players[0].Pass := PLAYER_PASSWORD;
Players[0].Nick := PLAYER_NICK;
Players[0].Active := True;
end;

procedure SetupCamera;
begin
Proggy('Setting up Camera and enabling Auto Retaliate');
KeyDown(VK_UP);
wait(randomrange(1500, 2500));
KeyUp(VK_UP);
Retaliate(true);
wait(randomrange(300, 500));
MakeCompass('N');
if IsRunOn(false) then
begin
Writeln('Run is on.');
end
else
begin
wait(randomrange(500,700));
mousebox (622, 412, 661, 452, 1);
wait(randomrange(500,700));
mousebox (567, 176, 590, 198, 1);
end;
end;

{---------------------------------FUNCTIONS------------------------------------}

function InCombat: Boolean; //credits to Saikek
var
x, y: Integer;
begin
if (FindColor(x, y, HPCOLOUR, 200, 100, 300, 200)) then
Result := true
else
Result := false
end;
var
monsterColors: TIntegerArray;
monsterUptexts: TStringArray;

function monkFound(): boolean;
var
x, y: integer;
begin
if (FindObjCustom(x, y, ['Attack', 'ttack', 'onk'], [MONKCOLOR1, MONKCOLOR2, MONKCOLOR3], 10)) then
begin
writeLn('monkFound(): result = true!');
result := true;
end else
begin
writeLn('monkFound(): result = false');
exit; // exit if none found
end;

procedure HumanMove; //NOTE TO SELF: IMPLEMENT THIS.
var
x, y: integer;
begin
case random(200) of
0..160: MMouse(RandomRange(X - 5, X + 5), RandomRange(y - 5, y + 5), 0, 0);
161..190: MMouse(RandomRange(X - 7, X + 7), RandomRange(y - 7, y + 7), 0, 0);
191..200: MMouse(RandomRange(X - 10, X + 10), RandomRange(y - 10, y + 10), 0, 0);
end;
end;
//procedure BoredCirlce; //Moves the mouse Around In a Circle
//var
//x, y: integer;
//begin
//
//end;
{---------------------------DO NOT GET BANNED----------------------------------}
procedure AntiBan; //NOOB LOOKING AT MY SCRIPT?
//var //ANTIBAN 101: http://villavu.com/forum/showthread.php?t=74999
//x, y: integer;
begin
Case Random(100) Of
1: begin Proggy('AntiBan: BoredHuman'); Boredhuman; end;
2: begin Proggy('AntiBan: BoredHuman'); PickUpMouse; end;
3: begin Proggy('AntiBan: RandomMovement'); RandomMovement; end;
4: begin Proggy('AntiBan: RandomRClick'); RandomRClick; end;

end;
end;
procedure MiniAntiBan; //WE CALL THIS SPECIFICALLY WHILST WAITING FOR MONKS TO DIE
//---!!MAKE MORE COMPLEX!!---
begin
Case Random(200) of //We mean waiting for our healthbar to disapear
1: begin Proggy('MiniAntiBan - Waiting for monk to die - BoredHuman'); BoredHuman; end;
2: begin Proggy('MiniAntiBan - Waiting for monk to die - RandomRClick'); RandomRClick; end;
3: begin Proggy('MiniAntiBan - Waiting for monk to die - RandomMovement'); RandomMovement; end;
4: begin Proggy('MiniAntiBan - Waiting for monk to die - SmallRandomMouse'); SmallRandomMouse; end;
// 5: begin Proggy('MiniAntiBan - Waiting for monk to die - HoverSkill'); HoverSkill(hitpoint, false); end;
5: begin Proggy('MiniAntiBan - Waiting for monk to die - HoverSkill'); HoverSkill(TRAININGSKILL, false); end;
6: begin Proggy('MiniAntiBan - Waiting for monk to die - Waiting'); wait(randomrange(1000,2000)); end;
7: begin end;
end;
end;

procedure MiniBreak;
begin
Case Random (160) of
1: begin Proggy('MiniBreak - Breaking - 40 to 60 seconds'); MMouseOffClient('rand'); Wait(randomrange(40000,60000)); end;
2: begin Proggy('MiniBreak - Breaking - 30 to 35 seconds'); MMouseOffClient('rand'); Wait(randomrange(30000,35000)); end;
3: begin Proggy('MiniBreak - Breaking - 20 to 29 seconds'); MMouseOffClient('rand'); Wait(randomrange(20000,29000)); end;
4: begin Proggy('MiniBreak - Breaking - 15 to 20 seconds'); MMouseOffClient('rand'); Wait(randomRange(15000,20000)); end;
end;
end;


procedure Heal;
var
hitpoints: integer;
x, y, monkchatbox: integer;

begin
Proggy('Checking Hitpoints');
if (GetSkillInfo(hitpoints, true) < HEALAT) then
begin
Proggy('Healing');
begin
PlaySound('C:/Simba/sound2.wav');
if (not InCombat) then
begin
while (not monkFound) do begin
if (FindObjCustom(x, y, ['Attack', 'ttack', 'onk'], [MONKCOLOR1, MONKCOLOR2, MONKCOLOR3], 10)) then
begin
ClickMouse2(mouse_right);
ChooseOption('alk');
monkchatbox := BitmapFromString(38, 11, 'meJx9VEEOwjAM29N5A6gSgmcg7T' + 'DGjQNoHPok3Hl1TTohRVOapHaSJkvTkqblNL6H4QC53D8QKGnO5Vt' + 'daQ0LApf04+3ZXHOGyzF59Iu0QxejLJRwZOROGpUrXFQwdVIERrl0' + 'UV5XQqVgDBaHgpzHl+Mrjb6NgVGwoaK+4Q7l+V8fmUcqCsNF2mVRz' + '3ctbhe4RAk7vhBAXVq0dkmzFHL2woPdwft6PVufVTGG4JDqLqPPJN' + '7OB96DS13dO/bBHIC+1c6IZWFp3lK+EbvH+K2ThKrVNeQ5hzH7UyP' + 'XU3vHABw5qyBiGqxRCfST4NsqOtwSgk9L+v2xeIZMvm30nDfqylL6' + 's74pw0jRXrlO14ZgkbSE9fkC7/HkKQ==');
repeat
begin
wait(randomrange(100, 300));
end;
until (FindBitmapToleranceIn(monkchatbox, x, y, 282, 362, 333, 383, 10));
mousebox(232, 443, 359, 459, 1);
wait(randomrange(300, 700));
mousebox(156, 387, 361, 400, 1);
wait(randomrange(300, 700));
mousebox(232, 443, 359, 459, 1);
wait(randomrange(300, 700));
mousebox(232, 443, 359, 459, 1);
monkFound := True; //We found the monk, and most likely killed it or whatever, mark as found
end;
Inc(MonkFindTries);
if (MonkFindTries > 10) then
break; //We havent found a monk in 5 tries, lets break the loop
end;
else
begin
Writeln('We need to heal but we are in combat! waiting..');
repeat
wait(randomrange(1000, 3000));
until(not InCombat)
begin
if (FindObjCustom(x, y, ['Attack', 'ttack', 'onk'], [MONKCOLOR1, MONKCOLOR2, MONKCOLOR3], 10)) then
ClickMouse2(mouse_right);
ChooseOption('alk');
monkchatbox := BitmapFromString(38, 11, 'meJx9VEEOwjAM29N5A6gSgmcg7T' + 'DGjQNoHPok3Hl1TTohRVOapHaSJkvTkqblNL6H4QC53D8QKGnO5Vt' + 'daQ0LApf04+3ZXHOGyzF59Iu0QxejLJRwZOROGpUrXFQwdVIERrl0' + 'UV5XQqVgDBaHgpzHl+Mrjb6NgVGwoaK+4Q7l+V8fmUcqCsNF2mVRz' + '3ctbhe4RAk7vhBAXVq0dkmzFHL2woPdwft6PVufVTGG4JDqLqPPJN' + '7OB96DS13dO/bBHIC+1c6IZWFp3lK+EbvH+K2ThKrVNeQ5hzH7UyP' + 'XU3vHABw5qyBiGqxRCfST4NsqOtwSgk9L+v2xeIZMvm30nDfqylL6' + 's74pw0jRXrlO14ZgkbSE9fkC7/HkKQ==');
repeat
begin
wait(randomrange(100, 300));
end;
until (FindBitmapToleranceIn(monkchatbox, x, y, 282, 362, 333, 383, 10));
mousebox(232, 443, 359, 459, 1);
wait(randomrange(300, 700));
mousebox(156, 387, 361, 400, 1);
wait(randomrange(300, 700));
mousebox(232, 443, 359, 459, 1);
wait(randomrange(300, 700));
mousebox(232, 443, 359, 459, 1);
end;
end;
end;
end
else
begin
Writeln('Hp is fine');
end;
end;

procedure Loot; //basic
var //NEEDS TPA
x, y, BonesDTM: integer;
LootItemsStr: string;
begin
Proggy('Looting');
if (ENABLEBURYB = 1) then //BONES
begin
BonesDTM := DTMFromString('m6wAAAHicjcw7CoBADEXRiKBiRp0PIkzj/jc0jYvRC5PCMoHziuQRFZGCjA0zdty2j7jsVqEYrbdaN+DAiQkJC57WyMHlJb18H7vffMzdDuA=');
Writeln('Burying bones is enabled');
begin
if (FindObjCustom(x, y, ['Take', 'ake', 'bones', 'ones'], [BONECOLOR], 5)) then
begin
MMouse(x, y, 3, 3);
ClickMouse2(mouse_right);
wait(randomrange(300,400));
ChooseOptionMulti(['ones', 'one']);
wait(randomrange(400,600));
MouseBox(628, 173, 655, 197, 1);
if FindDTM(BonesDTM, x, y, 552, 208, 735, 466) then
repeat
begin
MMouse(x, y, 3, 3);
ClickMouse2(mouse_left);
end;
until (not FindDTM(BonesDTM, x, y, 552, 208, 735, 466))
end
end;
end
else
begin
Writeln('Burying bones is not enabled');
end;
if (ENABLELOOT = 1) then //OTHER STUFF
begin
if (ENABLEBURYB = 1) then
begin
Writeln('Burying bones is enabled. We should already have looted them.');
Writeln('Our loot should be bellow us.');
while (IsMoving) do wait(500);
repeat
MouseBox(241, 180, 258, 194, Mouse_Move);
SMART_DrawBox(intToBox( 241, 180, 258, 194));
if IsUpTextMultiCustom(['ake', 'ke', 'Take']) then
begin
ClickMouse2(Mouse_Right);
ChooseOptionMulti([LOOTITEM1, LOOTITEM2, LOOTITEM3, LOOTITEM4, LOOTITEM5]);
end
else
begin
Writeln('Cannot find loot bellow us, we bugggd or your loot is enabled when it should not be.');
end;
until not IsUpTextMultiCustom(['ake', 'ke', 'Take', LOOTITEM1, LOOTITEM2, LOOTITEM3, LOOTITEM4, LOOTITEM5]);
end;
LootItemsStr:= 'Looting is enabled! Looting: ' + (LOOTITEM1) + (LOOTITEM2) + (LOOTITEM3) + (LOOTITEM4) + (LOOTITEM5);
Writeln(LootItemsStr);
if (FindObjCustom(x, y, ['Take', 'ake', 'bones', 'ones'], [BONECOLOR, LOOTCOLOR], 5)) then
begin
repeat
MMouse(x, y, 3, 3);
Clickmouse2(mouse_right);
wait(randomrange(200,300));
ChooseOptionMulti([LOOTITEM1, LOOTITEM2, LOOTITEM3, LOOTITEM4, LOOTITEM5]);
until not IsUpTextMultiCustom([LOOTITEM1, LOOTITEM2, LOOTITEM3, LOOTITEM4, LOOTITEM5]);
end;
end
else
begin
WriteLn('Looting not enabled!');
end;
end;


procedure AttackMonk;
var
starttime, x, y: integer;
begin
starttime := getsystemtime;
if (not InCombat) then
Writeln('Attacking Monk!');
repeat
Proggy('Attacking Monk');
wait(randomrange(1000,1400));
if (FindObjCustom(x, y, ['Attack', 'ttack', 'onk'], [MONKCOLOR1, MONKCOLOR2, MONKCOLOR3], 3)) then
begin
Writeln('Found monk. Clicking.');
MMouse(x, y, 3, 3);
ClickMouse2(mouse_left);
if DidYellowClick then
begin
repeat
Writeln('Misclicked monk - Trying again!');
if (FindObjCustom(x, y, ['Attack', 'ttack', 'onk'], [MONKCOLOR1, MONKCOLOR2, MONKCOLOR3], 10)) then
begin
Writeln('Found monk. Clicking.');
MMouse(x, y, 3, 3);
ClickMouse2(mouse_left);
end;
until(not DidYellowClick);
end;
end
else
begin
Writeln('Did not find monk. Random chance of moving Camera.');
case random(20) of
1: begin KeyDown(VK_LEFT); wait(randomrange(1000,1500)); KeyUp(VK_LEFT); end;
2: begin KeyDown(VK_RIGHT); wait(randomrange(1000,1500)); KeyUp(VK_RIGHT); end;
end;
end;
until (InCombat) or (getsystemtime - starttime > (randomrange(20000, 25000)));
while (InCombat) do begin Wait(1000); MiniAntiBan; end; //CALLS MiniAntiBan whilst InCombat is true
MonksKilled := MonksKilled +1
Writeln('We probably killed a monk.');
end;

begin
MouseSpeed := SPEEDMOUSE;
DeclarePlayers;
SetupSRL;
ActivateClient;
Wait(2000);
LoginPlayer;
SetupCamera;
repeat
if (not loggedin) then
begin
loginplayer;
setupcamera;
end;
if loggedin then
begin
AttackMonk;
Loot;
AntiBan;
MiniBreak;
Heal;
end;
until(false)
end.

SimbaGod

2014-02-28 17:13:35

Someone? :(

Solar

2014-02-28 18:02:07

For the first one, you missed an end; in the function or procedure before HumanMove.

Edit: Terrible standards TBH. Seems like the same issue again and again. Looks like anti-leech to me, which isn't allowed anymore. Sorry @SimbaGod; if I'm not much help.