Log in

View Full Version : ChaosMossKiller



Pages : 1 2 [3]

Jos3ph
07-07-2012, 11:08 PM
I just bought 25k steel knifes; what should I wear? Thanks guys.

Silentcore
07-08-2012, 12:59 AM
I just bought 25k steel knifes; what should I wear? Thanks guys.

If you are ranging, try wearing the best at your lvl..

Jos3ph
07-08-2012, 01:59 AM
best range level or just and hybrid it?

mormaii2
07-08-2012, 09:03 AM
IDK why but I bank alot for food...Seems every 4hours I bank and I am 98 def, should I do bones to peaches and if so what should I do? Whats the set up for bones to peaches, what runes, etc etc? Advice is much needed, thank you.

I'm 70 defence and i've botted over 30 hours there so far and haven't banked once because of bones to peaches. You should get bones to peaches tabs and in the script configuration turn bones to peaches to true. That's all

Shatterhand
07-08-2012, 06:29 PM
Guys, sorry to tell you, but your laziness is killing me... I already posted like 5 times about my range gear and xp/h.

chiatku03
07-08-2012, 09:35 PM
just checking in to say thanks and not leech. been using this script for awhile now. works amazing! best script ive tested so far. my max time was around 10hrs w/o smart manager which is outstanding. so far ive gotten 99 strength from this and im currently at 97 range. one again thanks a lot! :)

nathan lad
07-09-2012, 10:23 AM
for ranging void is the best armour to wear followed by armadyl/royal. as for weapon either msb or darts/knives. with void and rune darts (which are quite cheap) i was gettin 55k exp hr. also i used stuff like rangers, unholy book, archer ring i, to boost my range bonus

Leonardo Da Vinci
07-09-2012, 10:25 PM
Wow.
This is amazing. Absolutely brilliant.
THANK. YOU.

Jos3ph
07-09-2012, 10:39 PM
for ranging void is the best armour to wear followed by armadyl/royal. as for weapon either msb or darts/knives. with void and rune darts (which are quite cheap) i was gettin 55k exp hr. also i used stuff like rangers, unholy book, archer ring i, to boost my range bonus

Right now I am using Royal with rangers charm, void rangers helm, archer ring, ava, and I'm using rune arrows....

Should I switch to Rune Darts??

Leonardo Da Vinci
07-10-2012, 04:37 PM
Could someone explain to me how Bones to Peaches works in this script?
I know what it does, but if there are no bones to be picked up... What do the tablets do?
I'm just wondering how you guys do it, so I don't have to go to the bank every 45 minute to get some more lobbys.

Shatterhand
07-10-2012, 04:46 PM
Could someone explain to me how Bones to Peaches works in this script?
I know what it does, but if there are no bones to be picked up... What do the tablets do?
I'm just wondering how you guys do it, so I don't have to go to the bank every 45 minute to get some more lobbys.
Moss giants drop big bones. So actually its 'Big Bones to Peaches'. LOL.

Leonardo Da Vinci
07-10-2012, 05:01 PM
Moss giants drop big bones. So actually its 'Big Bones to Peaches'. LOL.

Oh shit, I thought I read somewhere that it only works on regular bones...
All this time I could have been optimizing this brilliant scripts' features!

So if it's like this
BonesToPeaches = False;
It will automatically pick up the bones and BtP when needed?
(I'm up to page 7 reading through the thread trying to find out, I apologize for my stupidity)

Shatterhand
07-10-2012, 05:19 PM
BonesToPeaches = False;
It will automatically pick up the bones and BtP when needed?

Set it 'True' and it will pick up Big bones, and break B2P when needed.

Leonardo Da Vinci
07-10-2012, 05:22 PM
Set it 'True' and it will pick up Big bones, and break B2P when needed.

Oops, I was going to edit that before I posted. My mistake.
Thanks again for such a brilliant script, I and many, many others appreciate your effort a great deal!

S i lex
07-11-2012, 06:36 AM
Don't have a pic, but I can assure you that I achieved 99 Attack with this script. This script is raw quality in my eyes.

Thank you.

Shatterhand
07-11-2012, 07:19 AM
Don't have a pic, but I can assure you that I achieved 99 Attack with this script. This script is raw quality in my eyes.

Thank you.
You should have the picture if TakeScreenShots was True. :)

Jeroen
07-11-2012, 06:01 PM
Thanks buddy! Love it! hehe :D
i hope i can get my Atk + Str alot higher before the nuke.. i have faith in simba so i hope they come back :p
http://i.imgur.com/GoF64.png

S i lex
07-11-2012, 11:07 PM
You should have the picture if TakeScreenShots was True. :)

Well, I ran the script until like 10k from 99, then I got the rest myself. That is why I have no picture :p

mormaii2
07-13-2012, 12:14 AM
The script had been working perfectly fine. Today i updated SRL,SPS,MSI on simba and the script has stopped working. I run it while i'm already logged in and everything and the script just doesn't start. This appears on simba.

SRL Compiled in 16 msec
SMART Initialized.
Loaded: Server 10, Members: True, Signed: True, Super Detail: False.

And then nothing else happens, any ideas?

Shatterhand
07-13-2012, 07:11 AM
The script had been working perfectly fine. Today i updated SRL,SPS,MSI on simba and the script has stopped working. I run it while i'm already logged in and everything and the script just doesn't start. This appears on simba.

SRL Compiled in 16 msec
SMART Initialized.
Loaded: Server 10, Members: True, Signed: True, Super Detail: False.

And then nothing else happens, any ideas?
The latest update (navigation bar) broke the bot. Most of the SRL functions doesnt work, so it wont even log in. Check out this thread for more info:
http://villavu.com/forum/showthread.php?t=86107
And please wait patiently. Dont spam the thread, the devs are getting mad.

gose
07-13-2012, 07:33 AM
achieven 65-99 r ange
80-99 attack
93-99ddef
70-96 str with this script runs flawless!

mormaii2
07-13-2012, 10:29 AM
The latest update (navigation bar) broke the bot. Most of the SRL functions doesnt work, so it wont even log in. Check out this thread for more info:
http://villavu.com/forum/showthread.php?t=86107
And please wait patiently. Dont spam the thread, the devs are getting mad.

I'm sorry i didn't know anything about the latest update. Hadn't botted for around 1 week and i just came back so i didn't know there was a RS update. I'll wait patiently then.

Shatterhand
07-14-2012, 03:27 PM
Updated the first post with proggies. Thanks for all! :D

Le Jingle
07-14-2012, 04:28 PM
Nice script, it's helped my noob gain many levels.
Also nice to see that you've hit 1k dl's on 6.0. Congrats! :>

yams
07-15-2012, 07:37 PM
About a week ago the bot was running with no problems...

Now, it takes 20+ minutes just to get to the login screen, and when it does get there it has no idea what to do and just sits there.

Can anybody help or is having similar problems?

Deus
07-15-2012, 08:22 PM
About a week ago the bot was running with no problems...

Now, it takes 20+ minutes just to get to the login screen, and when it does get there it has no idea what to do and just sits there.

Can anybody help or is having similar problems?

http://villavu.com/forum/showthread.php?t=86107

Zodia
07-17-2012, 08:57 AM
Is this script compatible with the temp fix o-O?

mormaii2
07-18-2012, 06:14 PM
Is this script compatible with the temp fix o-O?

I tried it but got a compilation error :/

bomzene
07-27-2012, 04:52 PM
Will this script be updated to work with Simba .991 that was released earlier, and the latest SMART?

Thanks.

ps. Asking because this script was so good! Would be a shame to see it die.

mormaii2
07-29-2012, 07:58 PM
Will this script be updated to work with Simba .991 that was released earlier, and the latest SMART?

Thanks.

ps. Asking because this script was so good! Would be a shame to see it die.

this ^ i want to know too

Leonardo Da Vinci
07-29-2012, 09:36 PM
Bumping.
We need this brilliant flawless script! We're too lazy to level up ourselves!
In all seriousness, I can't wait until this script works again.

bomzene
07-29-2012, 11:39 PM
Bumping.
We need this brilliant flawless script! We're too lazy to level up ourselves!
In all seriousness, I can't wait until this script works again.

Yes!!!! Same!! I only used the script for a few hours before Simba went down, but omg, it was amazing!

Really really would like this script to be updated!

Thanks to shatterhand for creating this is the first place.

Cwil
07-30-2012, 05:03 AM
Yes!!!! Same!! I only used the script for a few hours before Simba went down, but omg, it was amazing!

Really really would like this script to be updated!

Thanks to shatterhand for creating this is the first place.

Yeah i need a fighting script so i can get back to getting 99 range... can't wait to see one...

kevin33
07-30-2012, 05:15 AM
Well if everyone reads the update threads, you might learn how to fix it yourself. Hint* Its not that difficult. Only a few changes need to be made.

bomzene
07-30-2012, 12:04 PM
Well if everyone reads the update threads, you might learn how to fix it yourself. Hint* Its not that difficult. Only a few changes need to be made.

Have you tried fixing this script? If not, would you mind trying?

I did, it throws up all kinds of errors. I have fixed numerous other scripts in the same way, nearly all of them work. I assume some of the methods that this script uses have been changed.

Shatterhand
07-30-2012, 02:28 PM
1 more week until I get home guys... :)

bomzene
07-30-2012, 06:04 PM
1 more week until I get home guys... :)

Does that mean you will be updating this epic script? Possibly making some more awesome script to?

:D

Mat
07-31-2012, 12:51 PM
Hey Peepz Try this:

program ChaosMossKillerTempFixMat;
{$DEFINE SMART}
{$include_once SRL/SRL.simba}
{$include_once SPS/SPS.simba}
{$include_once SRL/SRL/Misc/Debug.simba}
{$include_once SRL/SRL/core/animation.simba}
{$include_once SRL/SRL/skill/magic.simba}
{$IFDEF SIMBAMAJOR980}
{$I SRL/SRL/Misc/PaintSmart.Simba} {$ELSE}
{$I SRL/SRL/Misc/SmartGraphics.Simba}
{$ENDIF}
const
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
//========================ChaosMossKiller by hunt3rx3=======================v6.0
//READ THESE CAREFULLY!======================================== ===========19 May
//*YOU MUST SET UP XP COUNTER FOR TRAINED LEVEL, OTHERWISE SCRIPT WONT WORK!====
//*FOOD:============================================ ============================
// -ONLY EATS LOBSTERS AND PEACHES=========================================== ==
// -DONT USE B2P WITH BONECRUSHER! COMMON SENSE================================
//*CHARM LOOTING:========================================== =====================
// -WILL PICK UP CHARMS WHAT YOU CAN SEE WITH YOUR EYES!=======================
// -WONT RIGHT CLICK ALL THE LOOT PILES!=======================================
// -HAVE 1+ OF EACH AT START!============================================ ======
//*SPECIAL ATTACKS:========================================== ===================
// -ONLY PRIMARY WORN WEAPONS, WONT SWITCH WEAPONS!============================
// -KORASI NOT SUPPORTED! WOULD MESS UP THE SCRIPT!============================
//================================================== ============================
SRLStats_User = ''; // Your SRL Stats ID (If you dont have one then just leave it as it is)
SRLStats_Password = ''; // Your SRL Stats Password (If you dont have one then just leave it as it is)

Username = '';
Password = '';

TrainedSkill = 'Strength'; // Attack, Strength, Defence, Range
XPCounter = 2; // 1,2,3
EatAt = 700; // 100-999

BonesToPeaches = True;
PickUpCharms = True;

UseSpecAttacks = False; // Only worn weapons. Not supported: Korasi.
SpecUsage = 55; // Spec usage of worn weapon. Supported: 25, 50, 55, 60, 100

PaintStatus = True; // set Private Chat off for this
PaintDebug = True;

TakeScreenShots = True; // (~100 kb jpeg, wont eat memory)
ScreenShotsPath = 'C:\Simba\Screenshots\ChaosMossKiller\';


DebugWindow = False;
DebugLines = False;
//================================================== ============================
//===========UPDATES: http://villavu.com/forum/showthread.php?t=74029===========
//================================================== ============================
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Version = 'v6.0';


var
X, Y: Integer;
StartTime, StartXp, StartXPtillNext, TrainedLevel, HpLevel : Integer;
WorldHops, B2PUsed, FoodUsed, GoldCharms, GreenCharms, BlueCharms, CrimsonCharms : Integer;
SpecWait, SpecTime, SpecNumber : Integer;
LastXP : Extended;
LevelString : String;
doreport, b2p : Boolean;



procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
with Players[0] do
begin
Name := UserName;
Pass := Password;
Active := True;
end;
end;



procedure MakeScreenShot(const FilePath : String); //example: 'C:\Simba\Screenshots\ChaosMossKiller\levelups'
var
fileName : String;
Year, Month, Day : Word;
i : Integer;
begin
if TakeScreenShots then
begin
if not DirectoryExists(ScreenShotsPath) then
CreateDirectory(ScreenShotsPath);
if not DirectoryExists(FilePath) then
CreateDirectory(FilePath);
DecodeDate(Date,Year,Month,Day);
i := 0;
repeat
i := i+1;
FileName := ToStr(Year) + '-' + ToStr(Month) + '-' + ToStr(Day) + ' (' + IntToStr(i) + ').jpg';
until not FileExists(FilePath + FileName)
SaveScreenShot(FilePath + FileName); //example: 2012-3-21 (1).jpg
end;
end;



procedure OpenDebugWindow(TPA: TPointArray; ATPA: array Of TPointArray; PaintBox: Boolean; Box: TBox); //box is for the dying Moss giant
var
BMP, x,y, i, Color : Integer;
TPABox: TBox;
begin
BMP := BitmapFromClient(0,0,MSX2,MSY2); //making a bitmap, adding the mainscreen image to it
DrawTPABitmap(BMP,TPA,clRed); //adding TPA to the bitmap

for i := 0 to high(ATPA) do
begin
if i = 0 then
Color := clYellow
else
Color := clBlack;

TPABox := getTPABounds(ATPA[i]); //getting the box of the TPA
for x := TPABox.x1 to TPABox.x2 do
begin
FastSetPixel(BMP, x, TPABox.y1, Color) //drawing lines
FastSetPixel(BMP, x, TPABox.y2, Color) //drawing lines
end;
for y := TPABox.y1 to TPABox.y2 do
begin
FastSetPixel(BMP, TPABox.x1, y, Color) //drawing lines
FastSetPixel(BMP, TPABox.x2, y, Color) //drawing lines
end;
end;

if PaintBox then //this is for the dying Moss giant
begin
for x := Box.x1 to Box.x2 do
begin
FastSetPixel(BMP, x, Box.y1, ClRed) //drawing lines
FastSetPixel(BMP, x, Box.y2, ClRed) //drawing lines
end;
for y := Box.y1 to Box.y2 do
begin
FastSetPixel(BMP, Box.x1, y, ClRed) //drawing lines
FastSetPixel(BMP, Box.x2, y, ClRed) //drawing lines
end;
end;
DebugBitmap(BMP);
FreeBitmap(BMP);
end;



function CurrentTime: string; //function for time, example [17:53:59]
var
Hour, Mins, Sec, MSec: Word;
begin
DecodeTime(Now, Hour, Mins, Sec, MSec);
Result := ('['+Padz(IntToStr(Hour), 2) + ':' + Padz(IntToStr(Mins), 2) + ':' + Padz(IntToStr(Sec), 2)+'] ');
end;



procedure EndScript(Reason : String); //function for ending, message box will pop up
begin
MakeScreenShot(ScreenShotsPath + 'stops\');
Disguise('Stopped');
Writeln(CurrentTime + Reason);
MessageBox(CurrentTime + Reason,'ChaosMossKiller Temp Fix By Mat',0); //message box as warning
TerminateScript;
end;



procedure StatusWithPaint(What : String); //Painting status on SMART
begin
Status(What);
if PaintStatus then
begin
SMART_ClearCanvasArea(IntToBox(MSX1,320,MSX2,343)) ;
SMART_DrawTextEx(False,8,322,SmallChars,What,ClWhi te); //drawing the text
end;
end;



procedure Report;
var
XP, XPHour, PrayXP, XPtillNext, TimeRun : Extended; //i have no clue why, but integer with Round() wont work
done : Boolean;
fails : Integer;
begin
if not DoReport then Exit;
fails := 0;
done := True;
repeat //reading XPCounter for xp gained
if (fails = 5) then
begin
Writeln(CurrentTime+'Failed to read XPBar. Turning off Reports.');
DoReport := False;
Exit;
end;
XP := GetXPBar(XPCounter)-StartXP;
if (XP + StartXP = -1) then //if fails to read xpbar it gives -1
begin
done := False;
fails := fails+1;
end;
until done

TimeRun := TimeFromMark(StartTime);
PrayXP := Round(XP / 240 * 15);
XPHour := Round(XP * (3600000 / TimeRun));
XPtillNext := StartXPtillNext - XP + LastXP; //LastXP = 0 untill we get a levelup

if (XPtillNext < 0) then //levelup check
begin
fails := 0;
done := True;
repeat //getting new level and xp till next
if (fails = 5) then
begin
Writeln(CurrentTime + 'Failed to get level/XPs. Turning off Reporting.');
DoReport := False;
Exit;
end;
TrainedLevel := GetSkillLevel(TrainedSkill);
if (TrainedLevel = -1) then //if fails to get level it gives -1
begin
done := False;
fails := fails+1;
end;
StartXPtillNext := XPTillNextLevel(TrainedSkill);
if (StartXPtillNext = -1) then //if fails to read xp it gives -1
begin
done := False;
fails := fails+1;
end;
until done

XPtillNext := StartXPtillNext;
LastXP := Round(XP); //we store the 'xp gained till now' (round is needed cause extended and integer)
MakeScreenShot(ScreenShotsPath + 'levelups\'); //this will make a screenshot of our levelup:)
Wait(RandomRange(3000,5000));
end;

ClearDebug;
Disguise('ChaosMossKiller [' + FloatToStr(XPHour) + ']');
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~');
WriteLn(' ChaosMossKiller ' + Version);
WriteLn(' * Time Running: ' + MsToTime(Round(TimeRun),Time_Formal));
WriteLn(' * ' + LevelString + ' XP Gained: ' + FloatToStr(XP) + ' (' + FloatToStr(XPHour) + ')');
Writeln(' * ' + LevelString + ' Level: ' + IntToStr(TrainedLevel) + ', XP till next: ' + FloatToStr(XPtillNext));
Writeln(' * B2P: ' + IntToStr(B2PUsed) + ' Food: ' + IntToStr(FoodUsed))
if PickUpCharms then
Writeln(' * Charms: ' + IntToStr(GoldCharms) + '/' + IntToStr(GreenCharms) + '/' + IntToStr(BlueCharms) + '/' + IntToStr(CrimsonCharms))
else
Writeln(' * Not picking up charms.');
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~');
end;



procedure Antiban; //basic antibans
begin
case Random(2400) of
1..2:
begin
StatusWithPaint('Checking trained level.');
TrainedLevel := GetSkillLevel(TrainedSkill);
HoverSkill(TrainedSkill,false);
Wait(RandomRange(1000,3000));
GameTab(tab_Inv);
StatusWithPaint('Back to fighting.');
end;
3..4:
begin
StatusWithPaint('Checking hp level.');
TrainedLevel := GetSkillLevel(TrainedSkill);
HoverSkill(SKILL_HITPOINTS,false);
Wait(RandomRange(1000,3000));
GameTab(tab_Inv);
StatusWithPaint('Back to fighting.');
end;
5..6:
begin
StatusWithPaint('Checking random level.');
TrainedLevel := GetSkillLevel(TrainedSkill);
HoverSkill('random',false);
Wait(RandomRange(1000,3000));
GameTab(tab_Inv);
StatusWithPaint('Back to fighting.');
end;
7..8: PickUpMouse;
9..14: CompassMovement(-180,180,false);
180..460: SleepAndMoveMouse(RandomRange(300,1200));
end;
end;



function BreakB2P : Boolean;
var
TabDTM : Integer;
fails : Integer;
done : Boolean;
begin
TabDTM := DTMFromString('78DA633CC4C4C070899101194CEEED65F80 2148289326E03AA398BAA868181894184014DCD0D026AF602D 53C20A0E614116A2E01D55C2742CD79FC6A00BDB80E80');
if not (GetCurrentTab = tab_Inv) then
GameTab(tab_Inv);
Wait(RandomRange(200,400));
fails := 0;
done := False;
repeat
if FindDTM(TabDTM,X,Y,MIX1,MIY1,MIX2,MIY2) then
begin
Mouse(X,Y,5,5,mouse_left); //clickig on B2P tab
Inc(B2PUsed);
Wait(RandomRange(6000,8000)); //it takes long to break it
Result := True;
done := True;
end else
begin
if not (GetCurrentTab = tab_Inv) then //sometimes it fails to switch tabs for the first time
GameTab(tab_Inv);
fails := fails+1;
end;
if (fails = 5) then //trying to find DTM 5 times max
begin
Result := False;
done := True;
end;
until done
FreeDTM(TabDTM);
end;



function EatFood(var foodDTMString : String): boolean;
var
FoodDTM, EatTime, CurrentHP, fails : Integer;
done : Boolean;
colorstring : String; //this is for a return value, not using it
begin
FoodDTM := DTMFromString(foodDTMString);
if not (GetCurrentTab = tab_Inv) then
GameTab(tab_Inv);
Wait(RandomRange(200,400));

fails := 0;
done := False;
repeat
if FindDTM(FoodDTM,X,Y,MIX1,MIY1,MIX2,MIY2) then
begin
CurrentHP := GetMMLevels('hp', colorstring);
MarkTime(eatTime);
repeat
MultiMouse(X,Y,80,2,true);
Wait(RandomRange(400,800));
if ( GetMMLevels('hp', colorstring) > (CurrentHP + 30) ) then //checking if HP is increased
begin
Inc(FoodUsed);
done := True;
Result := True;
end;
if (TimeFromMark(eatTime) > 10000) then
begin
Result := False;
done := True;
end;
until done
end
else
begin
if not (GetCurrentTab = tab_Inv) then //sometimes it fails to switch tabs for the first time
GameTab(tab_Inv);
fails := fails+1;
Wait(500);
end;

if (fails = 5) then //trying to find DTM max 5 times
begin
Result := False;
done := True;
end;
until done
FreeDTM(FoodDTM);
end;



function ChooseOptionCharms(What : String) : Boolean; //modified SRL function, this will loot charms if possible
var
B: TBox;
i, H, x: Integer;
T: TPoint;
Options: Array of TOptions;
begin
Result := False;
Options := GetChooseOptions('action');
if (Length(Options) < 1) then
Exit;
H := High(Options);

for i := 0 to H do
begin
if PickUpCharms then //if charms looting is enabled
begin
if Pos('ake Gold', Options[i].Str) > 0 Then
begin
StatusWithPaint('Found a Gold charm!');
Inc(GoldCharms);
Report;
Result := True;
B := Options[i].Bounds;
GetMousePos(T.x, T.y);
if PointInBox(T, B) then
ClickMouse2(true)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Exit;
end;

if Pos('ake Green', Options[i].Str) > 0 Then
begin
StatusWithPaint('Found a Green charm!');
Inc(GreenCharms);
Report;
Result := True;
B := Options[i].Bounds;
GetMousePos(T.x, T.y);
if PointInBox(T, B) then
ClickMouse2(true)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Exit;
end;

if Pos('ake Blue', Options[i].Str) > 0 Then
begin
StatusWithPaint('Found a Blue charm!');
Inc(BlueCharms);
Report;
Result := True;
B := Options[i].Bounds;
GetMousePos(T.x, T.y);
if PointInBox(T, B) then
ClickMouse2(true)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Exit;
end;

if Pos('ake Crims', Options[i].Str) > 0 Then
begin
StatusWithPaint('Found a Crimson charm!');
Report;
Inc(CrimsonCharms);
Result := True;
B := Options[i].Bounds;
GetMousePos(T.x, T.y);
if PointInBox(T, B) then
ClickMouse2(true)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Exit;
end;
end;

if Pos(What, Options[i].Str) > 0 Then //this will check for 'attack' or 'take bones' (nowhere else using ChooseOptionCharms)
begin
Result := True;
B := Options[i].Bounds;
GetMousePos(T.x, T.y);
if PointInBox(T, B) then
ClickMouse2(true)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Exit;
end;
end;

B := Options[0].BigBox; //to mmouse away
x := Max(B.X1 - 52, 0);
if x = 0 then
x := B.X2+10;
MMouse(x, Max(B.Y1 - 50, 0), 40, B.Y2-B.Y1);
Wait(200 + Random(100));
end;



function FindMoss(ClickOnIt: Boolean) : Boolean; //returns true only if clicked on a Moss giant
var
RedX, RedY, ExcX, ExcY, i, MinPoints, DetectTime, UptextTime, RedHpBarDTMTime, RedHpBarDTM : Integer;
TPA, MossTPA : TPointArray;
ATPA : Array of TPointArray;
MossColors, Tolerances : Array of Integer;
ExcludeNearRedHpBar : Boolean;
begin
Result := False;
MarkTime(DetectTime);
//6257521 (8) portal színe, tökéletes
//2173227 (5) nincs már sötét fal (eddig 7 jó volt)
//2372406 (8) nincs már (12 volt) nagyon kicsi barna fából
//2309694 (7) nincs nagyon nagyon kicsi barna fából
//3303025 (14) sárgásbarna, tökéletes
//4482405 (13)
MossColors := [6257521, 2173227, 2372406, 2309694, 3303025, 4482405];
Tolerances := [8, 5, 8, 7, 15, 13];
MinPoints := 200;

for i:=0 to High(MossColors) do
begin
FindColorsTolerance(MossTPA,MossColors[i],MSX1,MSY1,MSX2,MSY2,Tolerances[i]);
AppendTPA(TPA,MossTPA);
end;

ExcludeNearRedHpBar := False;
RedHpBarDTM := DTMFromString('mWAAAAHicY2FgYNgCxOeh+AIQRwFxOBDHQt k7GTgYrNmZ4FgEKIaMGdEwCAAAoEoGcA==');
if WaitFindDTMex(RedHpBarDTM,X,Y,MSX1,MSY1,MSX2,MSY2, 10,100) then //if found redbar then we will exclude points around it
begin
ExcludeNearRedHpBar := True;
RedX := X;
RedY := Y+50;
ExcX := 35;
ExcY := 60;
end;
FreeDTM(RedHpBarDTM);

if (High(TPA)> 0) then
begin

if ExcludeNearRedHpBar then //excluding near RedHpBar
begin
SortTPAFrom(TPA,Point(redX,redY));
InvertTPA(TPA);
for i:=0 to High(TPA) do
if (Abs(TPA[i].x - RedX) < ExcX) and (Abs(TPA[i].y - RedY) < ExcY) then
Break;
SetArrayLength(TPA,i);
end;

SortTPAFrom(TPA,Point(MSCX,MSCY)); //excluding points near middle
InvertTPA(TPA);
for i:=0 to High(TPA) do
if (Abs(TPA[i].x - MSCX) < 25) and (Abs(TPA[i].y - MSCY) < 25) then
Break;
SetArrayLength(TPA,i);

ATPA := SplitTPA(TPA,10); //splitting TPAs

SortATPASize(ATPA,True); //excluding TPAs with less than MinPoints points
for i:=0 to High(ATPA) do
begin
if High(ATPA[i]) < MinPoints then
Break;
end;
if i = 0 then Inc(i);
SetArrayLength(ATPA,i);

SortATPAFromFirstPoint(ATPA,Point(MSCX,MSCY)); //making the closest TPA the first in the array


if DebugWindow then //DebugWindow
OpenDebugWindow(TPA,ATPA,true,IntToBox(RedX-ExcX,RedY-ExcY,RedX+ExcX,RedY+ExcY));

if High(ATPA[0]) < MinPoints then //to avoid errors
Exit;


if ClickOnIt then
begin
if MiddleTPAEx(ATPA[0],X,Y) then //getting the middle point of the TPA, moving mouse there then looking for uptext
begin
MMouse(X,Y,0,0);
MarkTime(UptextTime);
if WaitUpText('ttack',200) then
begin
if DebugLines then //DebugLines
Writeln('Found Moss in ' + IntToStr(TimeFromMark(DetectTime)) + ' ms. Uptext was ' + IntToStr(TimeFromMark(UptextTime)) + ' ms.');
case Random(6) of //random left or rigth click (5:1)
0..4:
begin
ClickMouse2(mouse_left);
if DidRedClick then
Result := True; //returns true = clicked on moss
Exit;
end;
5:
begin
ClickMouse2(mouse_right);
if ChooseOption('ttack') then
Result := True; //returns true = clicked on moss
Exit;
end;
end;
end else
if DebugLines then //DebugLines
Writeln('Found Moss in ' + IntToStr(TimeFromMark(DetectTime)) + ' ms, but failed to find UpText.');
end;
end; //PaintDebug: clearing the drawings on SMART
end;
end;



function FindBones(X1,X2,X3,X4: Integer) : Boolean; //returns true if uptext is 'Take'
var
TPA : TPointArray;
ATPA : Array of TPointArray;
i : Integer;
MinPoints, xmid, ymid : Integer;
begin
MinPoints := 50;
FindColorsTolerance(TPA,11975103,X1,X2,X3,X4,25);

SortTPAFrom(TPA,Point(MSCX,MSCY)); //excluding points near middle
InvertTPA(TPA);
for i:=0 to High(TPA) do
if (Abs(TPA[i].x - MSCX) < 20) and (Abs(TPA[i].y - MSCY) < 25) then
Break;
SetArrayLength(TPA,i);

if (High(TPA)> 0) then
begin

ATPA := SplitTPA(TPA,10); //splitting the TPA

SortATPASize(ATPA,True); //excluding TPAs with less than MinPoints points
for i:=0 to High(ATPA) do
begin
if High(ATPA[i]) < MinPoints then
Break;
end;
if i = 0 then Inc(i);
SetArrayLength(ATPA,i);

if DebugWindow then //DebugWindow
OpenDebugWindow(TPA,ATPA,false,IntToBox(0,0,0,0));

if (High(ATPA[0]) < MinPoints) then //to avoid errors
Exit;

if MiddleTPAEx(ATPA[0],xmid,ymid) then //getting the middle point of the TPA, moving mouse there then looking for uptext
begin
MMouse(xmid,ymid,0,0);
Wait(100);
if IsUpTextEx('ake') then
begin
Result := True; //returning true
GetMousePos(X,Y);
Exit;
end;
end;
end;
Result := False;

end;



function FindCharm(Which: String; Colors, Tolerances: TIntegerArray; MinPoints: Integer) : Boolean; //returns true if uptext is 'Take'
var
TPA, CharmTPA : TPointArray;
ATPA : Array of TPointArray;
i : Integer;
xmid, ymid : Integer;
begin
for i:=0 to High(Colors) do
begin
FindColorsTolerance(CharmTPA,Colors[i],MSX1,MSY1,MSX2,MSY2,Tolerances[i]);
if DebugLines then //DebugLines
if (High(CharmTPA) > 0) then
Writeln('[Charms] Found ' + IntToStr(High(CharmTPA)) + ' pixels for Color: ' +IntToStr(Colors[i]) + '. Tolerance is: ' + IntToStr(Tolerances[i]));
AppendTPA(TPA,CharmTPA);
end;

SortTPAFrom(TPA,Point(MSCX,MSCY)); //excluding poinst near middle
InvertTPA(TPA);
for i:=0 to High(TPA) do
if (Abs(TPA[i].x - MSCX) < 30) and (Abs(TPA[i].y - MSCY) < 30) then
Break;
SetArrayLength(TPA,i);


if (High(TPA)> 0) then
begin
ATPA := SplitTPA(TPA,15); //splitting the TPA

SortATPASize(ATPA,True);

if High(ATPA[0]) < MinPoints then //getting only the biggest TPA (it everything is fine, this function wont find any extra pixels)
Exit;

if DebugWindow then //DebugWindow
OpenDebugWindow(TPA,ATPA,false,IntToBox(0,0,0,0));

if MiddleTPAEx(ATPA[0],xmid,ymid) then //getting the middle of the TPA, moving mouse there then looking for uptext
begin
MMouse(xmid,ymid,0,0);
Wait(100);
if PaintDebug then
SMART_ClearCanvasArea(IntToBox(MSX1,MSY1,MSX2,MSY2 ));
if IsUpTextEx('ake') then
begin
Result := True; //returning true
GetMousePos(X,Y);
Exit;
end;
end;
end;
Result := False;
end;



procedure FindAllCharms; //this will call the FindCharm() for all the charms with the given parameters
var
Colors, Tolerances : Array of Integer;
begin
if PickUpCharms then //if charms enabled
begin
StatusWithPaint('Looking for charms.');

Colors := [5804446,5935011,5344659,5735582,5472916];
Tolerances := [10,10,10,10,10];
if FindCharm('Gold',Colors,Tolerances,1) then
begin
Mouse(X,Y,0,0,mouse_right);
if ChooseOption('ake Gold') then
begin
StatusWithPaint('Picking up gold charm.');
Inc(GoldCharms);
Report;
Wait(1000);
repeat until not IsMoving
Wait(500);
end;
end;

Colors := [5010263,6982265,5471587,5730659];
Tolerances := [10,5,5,4];
if FindCharm('Green',Colors,Tolerances,1) then
begin
Mouse(X,Y,0,0,mouse_right);
if ChooseOption('ake Green') then
begin
StatusWithPaint('Picking up green charm.');
Inc(GreenCharms);
Report;
Wait(1000);
repeat until not IsMoving
Wait(500);
end;
end;

Colors := [6183977,8552249];
Tolerances := [10,10];
if FindCharm('Blue',Colors,Tolerances,1) then
begin
Mouse(X,Y,0,0,mouse_right);
if ChooseOption('ake Blue') then
begin
StatusWithPaint('Picking up blue charm.');
Inc(BlueCharms);
Report;
Wait(1000);
repeat until not IsMoving
Wait(500);
end;
end;

Colors := [3295859,2567297,3290481];
Tolerances := [8,8,10];
if FindCharm('Crimson',Colors,Tolerances,1) then
begin
Mouse(X,Y,0,0,mouse_right);
if ChooseOption('ake Crims') then
begin
StatusWithPaint('Picking up crimson charm.');
Inc(CrimsonCharms);
Report;
Wait(1000);
repeat until not IsMoving
Wait(500);
end;
end;

end;
end;



function WaitInFight(Timeout: Integer) : Boolean; //waits until Timeout or till we get into a fight (will return true in this case)
var
X,Y,XP1,XP2,ShieldDTM,Time : Integer;
begin
XP1 := GetXPBar(XPCounter);
MarkTime(Time);
ShieldDTM := DTMFromString('mQwAAAHicY2ZgYGBlYWAQAmIOIJZmZGCQAm J1IGax9mT4+/cvA9eCJwxcQHUwzIiEgQAAxXEFvA==');
repeat
XP2 := GetXPBar(XPCounter);
if (XP2 > XP1) then
begin
if DebugLines then
Writeln('XP is increased, we are fighting.');
if PaintDebug then
begin
SMART_DrawBoxEx(true,false,IntToBox(524,54,543,73) ,ClYellow);
Wait(100);
SMART_ClearCanvasArea(IntToBox(520,50,547,77));
end;
Result := True;
FreeDTM(ShieldDTM);
Exit;
end;
if (TimeFromMark(Time) > 3000) and FindDTM(ShieldDTM,X,Y,MSX1,MSY1,MSX2,MSY2) then //if xp is increased or shield dtm found (3000 seconds is for not the detect the blue shield of the previous fight)
begin
if DebugLines then
Writeln('Blue shield found, we are fighting.');
Result := True;
FreeDTM(ShieldDTM);
Exit;
end;
until (TimeFromMark(Time) > Timeout)
FreeDTM(ShieldDTM);
Result := False;
end;



function FindRedBar : Boolean;
var
X,Y,RedBarDTM : Integer;
begin
Result := False;
RedBarDTM := DTMFromString('mlwAAAHicY2dgYDBnZmCQBWIZKB0ExQpA3A iUr2OA0C1QDOPvZOBgsGZnwsBdDIwM+AAjHgwFAAvPB5w=');
if FindDTM(RedBarDTM,X,Y,MSX1,MSY1,MSX2,MSY2) then
begin
if DebugLines then
Writeln('Found redbar, we killed it.');
if PaintDebug then
begin
SMART_DrawBoxEx(true,false,IntToBox(X-30,Y-10,X+30,Y+10),ClYellow); //drawing box around the redbar
Wait(100);
SMART_ClearCanvasArea(IntToBox(MSX1,MSY1,MSX2,MSY2 ));
end;
Result := True;
end;
FreeDTM(RedBarDTM);
end;



procedure HopWorld;
var
FailTime : Integer;
begin
StatusWithPaint('Hopping.');
Inc(WorldHops);

MarkTime(FailTime);
repeat
ExitToLobby;
if TimeFromMark(FailTime) > 30000 then //sometimes RS crashes when going to lobby (black screen)
EndScript('Failed to exit to lobby when hopping.');
until LobbyScreen;

OpenWorldScreen;
SelectWorld(RandomWorld(true,false)); //member world, not pvp

MarkTime(FailTime);
repeat
LoginPlayer;
if TimeFromMark(FailTime) > 60000 then //sometimes RS crashes at login (black screen)
EndScript('Failed to login after hopping.');
until LoggedIn

Wait(RandomRange(500,6000));
ToggleXPBar(true);
SetAngle(SRL_ANGLE_HIGH);
end;



procedure WalkToCenter; //simple SPS walking to center (will improve in the future)
begin
StatusWithPaint('Walking to center.');
SPS_WalkToPos(Point(335, 374)); //no need randomness, because its not accurate
end;



procedure SpecialAttack;
var
X,Y,DTM100,DTM75,DTM60,DTM55,DTM50,DTM25,i,FailTim e : Integer;
begin
if UseSpecAttacks and ((TimeFromMark(SpecTime) > SpecWait) or (SpecNumber > 0)) then //will enter if specials are turned on AND (if its time to check for special OR we have remaining specials to do)
begin
StatusWithPaint('Checking special attack.');
DTM100 := DTMFromString('mWAAAAHicY2FgYHBgYmCwB+IjULyQkYFhHR AvAOI1QFyzIo9BSl+EwT/XkiGi2oGBC6gHGTOiYRAAAPnmCNY='); //DTMS for 100%,75% ... special bars
DTM75 := DTMFromString('mQwAAAHicY2ZgYLBnguAFIMzIwLAWiJcBsX OyIYOmpwJDep83AxdQHQwzImEgAAD6tQXo');
DTM60 := DTMFromString('mQwAAAHicY2ZgYHBgYmCwB+IuIF7EyMCwhh FCt2wuZTDyUmWYcKSegQuoDoYZkTAQAAAooAdH');
DTM55 := DTMFromString('mQwAAAHicY2ZgYGhmgeDjQCzNxMCgCcSyQO ycbMggpS/CMOFIPQMXUB0MMyJhIAAA5cgFbA==');
DTM50 := DTMFromString('mQwAAAHicY2ZgYHBgYmCwB+JaIF7EyMCwhh FCt2wuZTDyUmWYcKSegQuoDoYZkTAQAAAl1Qc6');
DTM25 := DTMFromString('mQwAAAHicY2ZgYHBgYmCwB+IoIF7EyMCwhh FCt2wuZTDyUmWYcKSegQuoDoYZkTAQAAAeUAcX');
SpecNumber := 0;
MarkTime(FailTime);
repeat
if (TimeFromMark(FailTime) > 5000) then Exit; //if failed to switch tabs, then it exits
GameTab(tab_Combat);
until (GetCurrentTab = tab_Combat)
SpecNumber := 0; //no matter if we have remaining specials to do, we will set it to 0 and determine it again
case SpecUsage of //determining how many specials we can do
100:
if FindDTM(DTM100,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
60:
if FindDTM(DTM60,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
55:
if FindDTM(DTM55,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
50:
begin
if FindDTM(DTM50,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
if FindDTM(DTM100,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 2;
end;
25:
begin
if FindDTM(DTM25,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
if FindDTM(DTM50,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 2;
if FindDTM(DTM75,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 3;
if FindDTM(DTM100,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 4;
end;
end;
MarkTime(SpecTime);
SpecWait := RandomRange(15000,60000); //next spec check in 15-60 seconds
if SpecNumber > 0 then //if we can spec
begin
StatusWithPaint('Using special attack.');
MouseBox(574,416,706,428,mouse_left);
Dec(SpecNumber);
end else //it cant do spec
begin
StatusWithPaint('Not enough special.');
Wait(RandomRange(500,4000));
StatusWithPaint('Back to fighting.');
MarkTime(FailTime);
repeat
if (TimeFromMark(FailTime) > 5000) then Exit;
GameTab(tab_Inv);
until (GetCurrentTab = tab_Inv)
end;
FreeDTM(DTM100);
FreeDTM(DTM75);
FreeDTM(DTM60);
FreeDTM(DTM55);
FreeDTM(DTM50);
FreeDTM(DTM25);
end;
end;



procedure LoginCheck;
begin
if not LoggedIn then
begin
StatusWithPaint('Logging in.');
if not LoginPlayer then
EndScript('We got logged out somehow and cant log in.');
end;
end;



procedure HpCheck;
var
colorstring, lobs, peaches : String;
FailTime, Amount : Integer;
done : Boolean;
begin
if (GetMMLevels('hp', colorstring) < EatAt) then
begin
MarkTime(FailTime);
repeat
if not b2p then //if not using B2P yet then we eat a simple food (lobster)
begin
StatusWithPaint('Eating lobster.');
Amount := 120; //healing amount for lobster
lobs := 'mggAAAHicY2NgYPjPxMDAzczAwMcMYX8E4p9ALMbIwMAKxNxA rMAI4fMC8f4EGaAuJgwsAiSxYUYcGAIAcgoGSA==';
if not EatFood(lobs) then
begin //if out of food
if not BonesToPeaches then //if not using B2P, then we log out
EndScript('Out of food.')
else
b2p := True; //lets start using B2P
end;
end;
if b2p then
begin
StatusWithPaint('Eating peaches.');
Amount := 80; //healing amount for peach
peaches := '78DA632C60626070626440069B3B52194480344C94310FA8C 60C550D030313AA9A32A01A0B026A6A806A1C08A8A906AA712 7A006E4663F026A52883007A4C69E809A4CC2FE0200D76708C 1'
if not EatFood(peaches) then //if out of peaches
begin
StatusWithPaint('Breaking B2P.');
if not BreakB2P then //if out of tablets
EndScript('Out of B2P tablets.');
if not EatFood(peaches) then //if broke tablet but cant eat peaches
EndScript('Failed to eat peaches after broking B2P.');
end;
end;
if (GetMMLevels('hp', colorstring) > (HpLevel * 10 - Amount)) or (TimeFromMark(FailTime) > 30000) then //if we no need to eat more (current hp > (maxhp - healamout)) (30 seconds timeout for fail safe)
done := True;
until done
end;
end;



procedure NoobCheck;
begin
if Length(GetMinimapDotsin('player',592,49,662,120)) > 0 then
begin
StatusWithPaint('Found a noob, waiting.');
MakeScreenShot('C:\Simba\Screenshots\ChaosMossKill er\noobs\');
Wait(RandomRange(5000,10000));
HopWorld;
end;
end;



function BonesCheck : Boolean;
var
LookedForBones : Integer;
begin
Result := False;
if BonesToPeaches then
begin //if using B2P then we need to collect bones
if not InvFull then
begin
LookedForBones := 0;
repeat
if FindBones(MSX1,MSY1,MSX2,MSY2) then
begin
StatusWithPaint('Picking up bones.');
Mouse(X,Y,0,0,mouse_right);
ChooseOptionCharms('ake Big');
Wait(1000);
repeat until not IsMoving
Result := True;
end;
Inc(LookedForBones);
until (InvFull) or (LookedForBones = 5) //looking for bones max 5 times (failsafe)
end;
end;
end;



procedure RandomsCheck;
begin
if FindNormalRandoms then
EndScript('Random event found!');
end;



procedure AmmoCheck; //function for Ranging
var
i : Integer;
done : Boolean;
begin
if LevelString = 'RNG' then
if FindChatBoxText('You have no ammo',8,ClBlack) then //ammo check
begin
StatusWithPaint('Out of ammo.');
Wait(1000);
if srl_inFight then
begin
StatusWithPaint('Still fighting, removing weapon.');
repeat until GameTab(tab_Inv)
if InvFull then
begin
i := 5;
done := False;
repeat
MMouseItem(i);
if IsUpTextMultiCustom(['Bury','ury','Eat','at']) then
begin
ClickMouse2(mouse_right);
if ChooseOptionMulti(['Drop','rop']) then
done := True;
end;
Inc(i);
until done
end;
repeat until GameTab(tab_Equip);
MouseBox(573,294,594,311,mouse_left);
StatusWithPaint('Removed weapon.');
EndScript('Out of ammo.');
end;

end;
end;



procedure SetupScript;
begin
ClearDebug;
Disguise('ChaosMossKiller Temp Fix By Mat');
Status('Starting script.');
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
Smart_Server := 24;
Smart_Members := Members;
Smart_Signed := Signed;
SMART_SuperDetail := False;
{$ELSE}
SmartPairClient(4440);
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
{$ENDIF}
SetupSRL;
ActivateClient;
DeclarePlayers;
SetupSRLStats(680, SRLStats_User, SRLStats_Password);
SPS_Setup(RUNESCAPE_OTHER,['chaos_tunnels']);
if PaintDebug then
SMART_ClearCanvas;
Status('Logging in.');
LoginPlayer;
end;



procedure Startup;
var
fails, FailTime : Integer;
done : Boolean;
begin
if srl_inFight then
begin
StatusWithPaint('Waiting till fight is over.');
repeat until not srl_InFight
end;

fails := 0;
done := True;
MarkTime(FailTime);
repeat
ToggleXPBar(True);
TrainedLevel := GetSkillLevel(TrainedSkill);
if (TrainedLevel = -1) then
begin
done := False;
fails := fails+1;
end;
HpLevel := GetSkillLevel('Hitpoints');
if (HpLevel = -1) then
begin
done := False;
fails := fails+1;
end;
StartXPtillNext := XPTillNextLevel(TrainedSkill);
if (StartXPtillNext = -1) then
begin
done := False;
fails := fails+1;
end;
StartXP := GetXPBar(XPCounter);
if (StartXP = -1) then
begin
done := False;
fails := fails+1;
end;
if (fails = 3) or (TimeFromMark(FailTime) > 30000) then
EndScript('Startup fail. Cant get level/read xps.');
until done

case TrainedSkill of
'Attack' : LevelString := 'ATK';
'Strength' : LevelString := 'STR';
'Defence' : LevelString := 'DEF';
'Range' : LevelString := 'RNG';
end;

case DebugLines of
true: doreport := False;
false: doreport := True;
end;

b2p := False;
LastXP := 0;
WorldHops := 0;
B2PUsed := 0;
FoodUsed := 0;
GoldCharms := 0;
GreenCharms := 0;
BlueCharms := 0;
CrimsonCharms := 0;

if UseSpecAttacks then
begin
SpecNumber := 0;
SpecWait := RandomRange(15000,45000);
MarkTime(SpecTime);
end;

ClearDebug;
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~');
WriteLn(' ChaosMossKiller Temp Fix By Mat ' + Version);
WriteLn(' - HP level : ' + IntToStr(HpLevel));
Writeln(' - ' + LevelString + ' level : ' + IntToStr(TrainedLevel));
Writeln(' - XP till next : ' + IntToStr(StartXPtillNext));
Writeln(' - XP Bar : ' + IntToStr(StartXP));
WriteLn(' - Starting script...');
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~');

MarkTime(StartTime);
SetAngle(SRL_ANGLE_HIGH);
end;



procedure Main;
var
DetectTime, KillTime : Integer;
done : Boolean;
begin
repeat

StatusWithPaint('Looking for Mosses.');
done := False;
MarkTime(DetectTime);
repeat
if (TimeFromMark(DetectTime) > 180000) then //180 seconds failsafe
EndScript('Cant find Mosses.');
if FindMoss(true) then //if clicked on moss
begin
if WaitInFight(4000) then //checking if we are fighting
done:=True
end else
begin //if failed to attack moss
StatusWithPaint(IntToStr(TimeFromMark(DetectTime)) +'ms');
case Random(20) of
0: CompassMovement(-120,120,false); //rotating camera for better view
end;
LoginCheck;
RandomsCheck;
if (TimeFromMark(DetectTime) > 10000) then //walking back to middle
WalkToCenter;
end;
until done //we are fighting now


StatusWithPaint('Fighting.');
MarkTime(KillTime);
repeat
Antiban;
AmmoCheck;
if (TimeFromMark(KillTime) < 5000) then //we dont want to waste special attack, so we only using it in the first 5 seconds
SpecialAttack;
if ((TimeFromMark(KillTime) > 5000) and (FindRedBar)) then //we are looking for redbar after 5 seconds of fighting
Break; //end of fight
Wait(500);
until ((TimeFromMark(KillTime) > 10000) and (not srl_inFight)) //failsafe is: 10 seconds and no hpbar above the player -> end of fight


StatusWithPaint('Killed Moss. Took '+MsToTime(TimeFromMark(KillTime),Time_Formal)+'.' );
Report;
stats_Commit; //committing stats (no variebles yet, only time)
BonesCheck; //this will look for bones if needed and pickst them up
FindAllCharms; //this will look for charms and picks them up
LoginCheck;
NoobCheck; //this will look for other players around
HpCheck; //this will check hp and eat (use b2p) if needed

until False
end;



begin

SetupScript;
Startup;
Main;

end.

This Complie so it should work unless RS Changed Anything.
Mat

Mjordan
08-01-2012, 12:36 AM
@Mat, your fix is lagging for a second right after it clicks on a mossie. Wasn't doing this before. I've added waits in every logical place I could think, but maybe I'm just being stupid and not seeing something. Mind giving it a look to see if you can fix the little lag? It's messing the mechanics up pretty bad.

EDIT: Nevermind I got it, knew I was just missing something. For anybody having the same problem, just add a random range wait right before checking for infight in the main loop.

Leonardo Da Vinci
08-01-2012, 10:14 AM
Hey Peepz Try this:

program ChaosMossKillerTempFixMat;
{$DEFINE SMART}
{$include_once SRL/SRL.simba}
{$include_once SPS/SPS.simba}
{$include_once SRL/SRL/Misc/Debug.simba}
{$include_once SRL/SRL/core/animation.simba}
{$include_once SRL/SRL/skill/magic.simba}
{$IFDEF SIMBAMAJOR980}
{$I SRL/SRL/Misc/PaintSmart.Simba} {$ELSE}
{$I SRL/SRL/Misc/SmartGraphics.Simba}
{$ENDIF}
const
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
//========================ChaosMossKiller by hunt3rx3=======================v6.0
//READ THESE CAREFULLY!======================================== ===========19 May
//*YOU MUST SET UP XP COUNTER FOR TRAINED LEVEL, OTHERWISE SCRIPT WONT WORK!====
//*FOOD:============================================ ============================
// -ONLY EATS LOBSTERS AND PEACHES=========================================== ==
// -DONT USE B2P WITH BONECRUSHER! COMMON SENSE================================
//*CHARM LOOTING:========================================== =====================
// -WILL PICK UP CHARMS WHAT YOU CAN SEE WITH YOUR EYES!=======================
// -WONT RIGHT CLICK ALL THE LOOT PILES!=======================================
// -HAVE 1+ OF EACH AT START!============================================ ======
//*SPECIAL ATTACKS:========================================== ===================
// -ONLY PRIMARY WORN WEAPONS, WONT SWITCH WEAPONS!============================
// -KORASI NOT SUPPORTED! WOULD MESS UP THE SCRIPT!============================
//================================================== ============================
SRLStats_User = ''; // Your SRL Stats ID (If you dont have one then just leave it as it is)
SRLStats_Password = ''; // Your SRL Stats Password (If you dont have one then just leave it as it is)

Username = '';
Password = '';

TrainedSkill = 'Strength'; // Attack, Strength, Defence, Range
XPCounter = 2; // 1,2,3
EatAt = 700; // 100-999

BonesToPeaches = True;
PickUpCharms = True;

UseSpecAttacks = False; // Only worn weapons. Not supported: Korasi.
SpecUsage = 55; // Spec usage of worn weapon. Supported: 25, 50, 55, 60, 100

PaintStatus = True; // set Private Chat off for this
PaintDebug = True;

TakeScreenShots = True; // (~100 kb jpeg, wont eat memory)
ScreenShotsPath = 'C:\Simba\Screenshots\ChaosMossKiller\';


DebugWindow = False;
DebugLines = False;
//================================================== ============================
//===========UPDATES: http://villavu.com/forum/showthread.php?t=74029===========
//================================================== ============================
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Version = 'v6.0';


var
X, Y: Integer;
StartTime, StartXp, StartXPtillNext, TrainedLevel, HpLevel : Integer;
WorldHops, B2PUsed, FoodUsed, GoldCharms, GreenCharms, BlueCharms, CrimsonCharms : Integer;
SpecWait, SpecTime, SpecNumber : Integer;
LastXP : Extended;
LevelString : String;
doreport, b2p : Boolean;



procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
with Players[0] do
begin
Name := UserName;
Pass := Password;
Active := True;
end;
end;



procedure MakeScreenShot(const FilePath : String); //example: 'C:\Simba\Screenshots\ChaosMossKiller\levelups'
var
fileName : String;
Year, Month, Day : Word;
i : Integer;
begin
if TakeScreenShots then
begin
if not DirectoryExists(ScreenShotsPath) then
CreateDirectory(ScreenShotsPath);
if not DirectoryExists(FilePath) then
CreateDirectory(FilePath);
DecodeDate(Date,Year,Month,Day);
i := 0;
repeat
i := i+1;
FileName := ToStr(Year) + '-' + ToStr(Month) + '-' + ToStr(Day) + ' (' + IntToStr(i) + ').jpg';
until not FileExists(FilePath + FileName)
SaveScreenShot(FilePath + FileName); //example: 2012-3-21 (1).jpg
end;
end;



procedure OpenDebugWindow(TPA: TPointArray; ATPA: array Of TPointArray; PaintBox: Boolean; Box: TBox); //box is for the dying Moss giant
var
BMP, x,y, i, Color : Integer;
TPABox: TBox;
begin
BMP := BitmapFromClient(0,0,MSX2,MSY2); //making a bitmap, adding the mainscreen image to it
DrawTPABitmap(BMP,TPA,clRed); //adding TPA to the bitmap

for i := 0 to high(ATPA) do
begin
if i = 0 then
Color := clYellow
else
Color := clBlack;

TPABox := getTPABounds(ATPA[i]); //getting the box of the TPA
for x := TPABox.x1 to TPABox.x2 do
begin
FastSetPixel(BMP, x, TPABox.y1, Color) //drawing lines
FastSetPixel(BMP, x, TPABox.y2, Color) //drawing lines
end;
for y := TPABox.y1 to TPABox.y2 do
begin
FastSetPixel(BMP, TPABox.x1, y, Color) //drawing lines
FastSetPixel(BMP, TPABox.x2, y, Color) //drawing lines
end;
end;

if PaintBox then //this is for the dying Moss giant
begin
for x := Box.x1 to Box.x2 do
begin
FastSetPixel(BMP, x, Box.y1, ClRed) //drawing lines
FastSetPixel(BMP, x, Box.y2, ClRed) //drawing lines
end;
for y := Box.y1 to Box.y2 do
begin
FastSetPixel(BMP, Box.x1, y, ClRed) //drawing lines
FastSetPixel(BMP, Box.x2, y, ClRed) //drawing lines
end;
end;
DebugBitmap(BMP);
FreeBitmap(BMP);
end;



function CurrentTime: string; //function for time, example [17:53:59]
var
Hour, Mins, Sec, MSec: Word;
begin
DecodeTime(Now, Hour, Mins, Sec, MSec);
Result := ('['+Padz(IntToStr(Hour), 2) + ':' + Padz(IntToStr(Mins), 2) + ':' + Padz(IntToStr(Sec), 2)+'] ');
end;



procedure EndScript(Reason : String); //function for ending, message box will pop up
begin
MakeScreenShot(ScreenShotsPath + 'stops\');
Disguise('Stopped');
Writeln(CurrentTime + Reason);
MessageBox(CurrentTime + Reason,'ChaosMossKiller Temp Fix By Mat',0); //message box as warning
TerminateScript;
end;



procedure StatusWithPaint(What : String); //Painting status on SMART
begin
Status(What);
if PaintStatus then
begin
SMART_ClearCanvasArea(IntToBox(MSX1,320,MSX2,343)) ;
SMART_DrawTextEx(False,8,322,SmallChars,What,ClWhi te); //drawing the text
end;
end;



procedure Report;
var
XP, XPHour, PrayXP, XPtillNext, TimeRun : Extended; //i have no clue why, but integer with Round() wont work
done : Boolean;
fails : Integer;
begin
if not DoReport then Exit;
fails := 0;
done := True;
repeat //reading XPCounter for xp gained
if (fails = 5) then
begin
Writeln(CurrentTime+'Failed to read XPBar. Turning off Reports.');
DoReport := False;
Exit;
end;
XP := GetXPBar(XPCounter)-StartXP;
if (XP + StartXP = -1) then //if fails to read xpbar it gives -1
begin
done := False;
fails := fails+1;
end;
until done

TimeRun := TimeFromMark(StartTime);
PrayXP := Round(XP / 240 * 15);
XPHour := Round(XP * (3600000 / TimeRun));
XPtillNext := StartXPtillNext - XP + LastXP; //LastXP = 0 untill we get a levelup

if (XPtillNext < 0) then //levelup check
begin
fails := 0;
done := True;
repeat //getting new level and xp till next
if (fails = 5) then
begin
Writeln(CurrentTime + 'Failed to get level/XPs. Turning off Reporting.');
DoReport := False;
Exit;
end;
TrainedLevel := GetSkillLevel(TrainedSkill);
if (TrainedLevel = -1) then //if fails to get level it gives -1
begin
done := False;
fails := fails+1;
end;
StartXPtillNext := XPTillNextLevel(TrainedSkill);
if (StartXPtillNext = -1) then //if fails to read xp it gives -1
begin
done := False;
fails := fails+1;
end;
until done

XPtillNext := StartXPtillNext;
LastXP := Round(XP); //we store the 'xp gained till now' (round is needed cause extended and integer)
MakeScreenShot(ScreenShotsPath + 'levelups\'); //this will make a screenshot of our levelup:)
Wait(RandomRange(3000,5000));
end;

ClearDebug;
Disguise('ChaosMossKiller [' + FloatToStr(XPHour) + ']');
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~');
WriteLn(' ChaosMossKiller ' + Version);
WriteLn(' * Time Running: ' + MsToTime(Round(TimeRun),Time_Formal));
WriteLn(' * ' + LevelString + ' XP Gained: ' + FloatToStr(XP) + ' (' + FloatToStr(XPHour) + ')');
Writeln(' * ' + LevelString + ' Level: ' + IntToStr(TrainedLevel) + ', XP till next: ' + FloatToStr(XPtillNext));
Writeln(' * B2P: ' + IntToStr(B2PUsed) + ' Food: ' + IntToStr(FoodUsed))
if PickUpCharms then
Writeln(' * Charms: ' + IntToStr(GoldCharms) + '/' + IntToStr(GreenCharms) + '/' + IntToStr(BlueCharms) + '/' + IntToStr(CrimsonCharms))
else
Writeln(' * Not picking up charms.');
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~');
end;



procedure Antiban; //basic antibans
begin
case Random(2400) of
1..2:
begin
StatusWithPaint('Checking trained level.');
TrainedLevel := GetSkillLevel(TrainedSkill);
HoverSkill(TrainedSkill,false);
Wait(RandomRange(1000,3000));
GameTab(tab_Inv);
StatusWithPaint('Back to fighting.');
end;
3..4:
begin
StatusWithPaint('Checking hp level.');
TrainedLevel := GetSkillLevel(TrainedSkill);
HoverSkill(SKILL_HITPOINTS,false);
Wait(RandomRange(1000,3000));
GameTab(tab_Inv);
StatusWithPaint('Back to fighting.');
end;
5..6:
begin
StatusWithPaint('Checking random level.');
TrainedLevel := GetSkillLevel(TrainedSkill);
HoverSkill('random',false);
Wait(RandomRange(1000,3000));
GameTab(tab_Inv);
StatusWithPaint('Back to fighting.');
end;
7..8: PickUpMouse;
9..14: CompassMovement(-180,180,false);
180..460: SleepAndMoveMouse(RandomRange(300,1200));
end;
end;



function BreakB2P : Boolean;
var
TabDTM : Integer;
fails : Integer;
done : Boolean;
begin
TabDTM := DTMFromString('78DA633CC4C4C070899101194CEEED65F80 2148289326E03AA398BAA868181894184014DCD0D026AF602D 53C20A0E614116A2E01D55C2742CD79FC6A00BDB80E80');
if not (GetCurrentTab = tab_Inv) then
GameTab(tab_Inv);
Wait(RandomRange(200,400));
fails := 0;
done := False;
repeat
if FindDTM(TabDTM,X,Y,MIX1,MIY1,MIX2,MIY2) then
begin
Mouse(X,Y,5,5,mouse_left); //clickig on B2P tab
Inc(B2PUsed);
Wait(RandomRange(6000,8000)); //it takes long to break it
Result := True;
done := True;
end else
begin
if not (GetCurrentTab = tab_Inv) then //sometimes it fails to switch tabs for the first time
GameTab(tab_Inv);
fails := fails+1;
end;
if (fails = 5) then //trying to find DTM 5 times max
begin
Result := False;
done := True;
end;
until done
FreeDTM(TabDTM);
end;



function EatFood(var foodDTMString : String): boolean;
var
FoodDTM, EatTime, CurrentHP, fails : Integer;
done : Boolean;
colorstring : String; //this is for a return value, not using it
begin
FoodDTM := DTMFromString(foodDTMString);
if not (GetCurrentTab = tab_Inv) then
GameTab(tab_Inv);
Wait(RandomRange(200,400));

fails := 0;
done := False;
repeat
if FindDTM(FoodDTM,X,Y,MIX1,MIY1,MIX2,MIY2) then
begin
CurrentHP := GetMMLevels('hp', colorstring);
MarkTime(eatTime);
repeat
MultiMouse(X,Y,80,2,true);
Wait(RandomRange(400,800));
if ( GetMMLevels('hp', colorstring) > (CurrentHP + 30) ) then //checking if HP is increased
begin
Inc(FoodUsed);
done := True;
Result := True;
end;
if (TimeFromMark(eatTime) > 10000) then
begin
Result := False;
done := True;
end;
until done
end
else
begin
if not (GetCurrentTab = tab_Inv) then //sometimes it fails to switch tabs for the first time
GameTab(tab_Inv);
fails := fails+1;
Wait(500);
end;

if (fails = 5) then //trying to find DTM max 5 times
begin
Result := False;
done := True;
end;
until done
FreeDTM(FoodDTM);
end;



function ChooseOptionCharms(What : String) : Boolean; //modified SRL function, this will loot charms if possible
var
B: TBox;
i, H, x: Integer;
T: TPoint;
Options: Array of TOptions;
begin
Result := False;
Options := GetChooseOptions('action');
if (Length(Options) < 1) then
Exit;
H := High(Options);

for i := 0 to H do
begin
if PickUpCharms then //if charms looting is enabled
begin
if Pos('ake Gold', Options[i].Str) > 0 Then
begin
StatusWithPaint('Found a Gold charm!');
Inc(GoldCharms);
Report;
Result := True;
B := Options[i].Bounds;
GetMousePos(T.x, T.y);
if PointInBox(T, B) then
ClickMouse2(true)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Exit;
end;

if Pos('ake Green', Options[i].Str) > 0 Then
begin
StatusWithPaint('Found a Green charm!');
Inc(GreenCharms);
Report;
Result := True;
B := Options[i].Bounds;
GetMousePos(T.x, T.y);
if PointInBox(T, B) then
ClickMouse2(true)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Exit;
end;

if Pos('ake Blue', Options[i].Str) > 0 Then
begin
StatusWithPaint('Found a Blue charm!');
Inc(BlueCharms);
Report;
Result := True;
B := Options[i].Bounds;
GetMousePos(T.x, T.y);
if PointInBox(T, B) then
ClickMouse2(true)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Exit;
end;

if Pos('ake Crims', Options[i].Str) > 0 Then
begin
StatusWithPaint('Found a Crimson charm!');
Report;
Inc(CrimsonCharms);
Result := True;
B := Options[i].Bounds;
GetMousePos(T.x, T.y);
if PointInBox(T, B) then
ClickMouse2(true)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Exit;
end;
end;

if Pos(What, Options[i].Str) > 0 Then //this will check for 'attack' or 'take bones' (nowhere else using ChooseOptionCharms)
begin
Result := True;
B := Options[i].Bounds;
GetMousePos(T.x, T.y);
if PointInBox(T, B) then
ClickMouse2(true)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Exit;
end;
end;

B := Options[0].BigBox; //to mmouse away
x := Max(B.X1 - 52, 0);
if x = 0 then
x := B.X2+10;
MMouse(x, Max(B.Y1 - 50, 0), 40, B.Y2-B.Y1);
Wait(200 + Random(100));
end;



function FindMoss(ClickOnIt: Boolean) : Boolean; //returns true only if clicked on a Moss giant
var
RedX, RedY, ExcX, ExcY, i, MinPoints, DetectTime, UptextTime, RedHpBarDTMTime, RedHpBarDTM : Integer;
TPA, MossTPA : TPointArray;
ATPA : Array of TPointArray;
MossColors, Tolerances : Array of Integer;
ExcludeNearRedHpBar : Boolean;
begin
Result := False;
MarkTime(DetectTime);
//6257521 (8) portal színe, tökéletes
//2173227 (5) nincs már sötét fal (eddig 7 jó volt)
//2372406 (8) nincs már (12 volt) nagyon kicsi barna fából
//2309694 (7) nincs nagyon nagyon kicsi barna fából
//3303025 (14) sárgásbarna, tökéletes
//4482405 (13)
MossColors := [6257521, 2173227, 2372406, 2309694, 3303025, 4482405];
Tolerances := [8, 5, 8, 7, 15, 13];
MinPoints := 200;

for i:=0 to High(MossColors) do
begin
FindColorsTolerance(MossTPA,MossColors[i],MSX1,MSY1,MSX2,MSY2,Tolerances[i]);
AppendTPA(TPA,MossTPA);
end;

ExcludeNearRedHpBar := False;
RedHpBarDTM := DTMFromString('mWAAAAHicY2FgYNgCxOeh+AIQRwFxOBDHQt k7GTgYrNmZ4FgEKIaMGdEwCAAAoEoGcA==');
if WaitFindDTMex(RedHpBarDTM,X,Y,MSX1,MSY1,MSX2,MSY2, 10,100) then //if found redbar then we will exclude points around it
begin
ExcludeNearRedHpBar := True;
RedX := X;
RedY := Y+50;
ExcX := 35;
ExcY := 60;
end;
FreeDTM(RedHpBarDTM);

if (High(TPA)> 0) then
begin

if ExcludeNearRedHpBar then //excluding near RedHpBar
begin
SortTPAFrom(TPA,Point(redX,redY));
InvertTPA(TPA);
for i:=0 to High(TPA) do
if (Abs(TPA[i].x - RedX) < ExcX) and (Abs(TPA[i].y - RedY) < ExcY) then
Break;
SetArrayLength(TPA,i);
end;

SortTPAFrom(TPA,Point(MSCX,MSCY)); //excluding points near middle
InvertTPA(TPA);
for i:=0 to High(TPA) do
if (Abs(TPA[i].x - MSCX) < 25) and (Abs(TPA[i].y - MSCY) < 25) then
Break;
SetArrayLength(TPA,i);

ATPA := SplitTPA(TPA,10); //splitting TPAs

SortATPASize(ATPA,True); //excluding TPAs with less than MinPoints points
for i:=0 to High(ATPA) do
begin
if High(ATPA[i]) < MinPoints then
Break;
end;
if i = 0 then Inc(i);
SetArrayLength(ATPA,i);

SortATPAFromFirstPoint(ATPA,Point(MSCX,MSCY)); //making the closest TPA the first in the array


if DebugWindow then //DebugWindow
OpenDebugWindow(TPA,ATPA,true,IntToBox(RedX-ExcX,RedY-ExcY,RedX+ExcX,RedY+ExcY));

if High(ATPA[0]) < MinPoints then //to avoid errors
Exit;


if ClickOnIt then
begin
if MiddleTPAEx(ATPA[0],X,Y) then //getting the middle point of the TPA, moving mouse there then looking for uptext
begin
MMouse(X,Y,0,0);
MarkTime(UptextTime);
if WaitUpText('ttack',200) then
begin
if DebugLines then //DebugLines
Writeln('Found Moss in ' + IntToStr(TimeFromMark(DetectTime)) + ' ms. Uptext was ' + IntToStr(TimeFromMark(UptextTime)) + ' ms.');
case Random(6) of //random left or rigth click (5:1)
0..4:
begin
ClickMouse2(mouse_left);
if DidRedClick then
Result := True; //returns true = clicked on moss
Exit;
end;
5:
begin
ClickMouse2(mouse_right);
if ChooseOption('ttack') then
Result := True; //returns true = clicked on moss
Exit;
end;
end;
end else
if DebugLines then //DebugLines
Writeln('Found Moss in ' + IntToStr(TimeFromMark(DetectTime)) + ' ms, but failed to find UpText.');
end;
end; //PaintDebug: clearing the drawings on SMART
end;
end;



function FindBones(X1,X2,X3,X4: Integer) : Boolean; //returns true if uptext is 'Take'
var
TPA : TPointArray;
ATPA : Array of TPointArray;
i : Integer;
MinPoints, xmid, ymid : Integer;
begin
MinPoints := 50;
FindColorsTolerance(TPA,11975103,X1,X2,X3,X4,25);

SortTPAFrom(TPA,Point(MSCX,MSCY)); //excluding points near middle
InvertTPA(TPA);
for i:=0 to High(TPA) do
if (Abs(TPA[i].x - MSCX) < 20) and (Abs(TPA[i].y - MSCY) < 25) then
Break;
SetArrayLength(TPA,i);

if (High(TPA)> 0) then
begin

ATPA := SplitTPA(TPA,10); //splitting the TPA

SortATPASize(ATPA,True); //excluding TPAs with less than MinPoints points
for i:=0 to High(ATPA) do
begin
if High(ATPA[i]) < MinPoints then
Break;
end;
if i = 0 then Inc(i);
SetArrayLength(ATPA,i);

if DebugWindow then //DebugWindow
OpenDebugWindow(TPA,ATPA,false,IntToBox(0,0,0,0));

if (High(ATPA[0]) < MinPoints) then //to avoid errors
Exit;

if MiddleTPAEx(ATPA[0],xmid,ymid) then //getting the middle point of the TPA, moving mouse there then looking for uptext
begin
MMouse(xmid,ymid,0,0);
Wait(100);
if IsUpTextEx('ake') then
begin
Result := True; //returning true
GetMousePos(X,Y);
Exit;
end;
end;
end;
Result := False;

end;



function FindCharm(Which: String; Colors, Tolerances: TIntegerArray; MinPoints: Integer) : Boolean; //returns true if uptext is 'Take'
var
TPA, CharmTPA : TPointArray;
ATPA : Array of TPointArray;
i : Integer;
xmid, ymid : Integer;
begin
for i:=0 to High(Colors) do
begin
FindColorsTolerance(CharmTPA,Colors[i],MSX1,MSY1,MSX2,MSY2,Tolerances[i]);
if DebugLines then //DebugLines
if (High(CharmTPA) > 0) then
Writeln('[Charms] Found ' + IntToStr(High(CharmTPA)) + ' pixels for Color: ' +IntToStr(Colors[i]) + '. Tolerance is: ' + IntToStr(Tolerances[i]));
AppendTPA(TPA,CharmTPA);
end;

SortTPAFrom(TPA,Point(MSCX,MSCY)); //excluding poinst near middle
InvertTPA(TPA);
for i:=0 to High(TPA) do
if (Abs(TPA[i].x - MSCX) < 30) and (Abs(TPA[i].y - MSCY) < 30) then
Break;
SetArrayLength(TPA,i);


if (High(TPA)> 0) then
begin
ATPA := SplitTPA(TPA,15); //splitting the TPA

SortATPASize(ATPA,True);

if High(ATPA[0]) < MinPoints then //getting only the biggest TPA (it everything is fine, this function wont find any extra pixels)
Exit;

if DebugWindow then //DebugWindow
OpenDebugWindow(TPA,ATPA,false,IntToBox(0,0,0,0));

if MiddleTPAEx(ATPA[0],xmid,ymid) then //getting the middle of the TPA, moving mouse there then looking for uptext
begin
MMouse(xmid,ymid,0,0);
Wait(100);
if PaintDebug then
SMART_ClearCanvasArea(IntToBox(MSX1,MSY1,MSX2,MSY2 ));
if IsUpTextEx('ake') then
begin
Result := True; //returning true
GetMousePos(X,Y);
Exit;
end;
end;
end;
Result := False;
end;



procedure FindAllCharms; //this will call the FindCharm() for all the charms with the given parameters
var
Colors, Tolerances : Array of Integer;
begin
if PickUpCharms then //if charms enabled
begin
StatusWithPaint('Looking for charms.');

Colors := [5804446,5935011,5344659,5735582,5472916];
Tolerances := [10,10,10,10,10];
if FindCharm('Gold',Colors,Tolerances,1) then
begin
Mouse(X,Y,0,0,mouse_right);
if ChooseOption('ake Gold') then
begin
StatusWithPaint('Picking up gold charm.');
Inc(GoldCharms);
Report;
Wait(1000);
repeat until not IsMoving
Wait(500);
end;
end;

Colors := [5010263,6982265,5471587,5730659];
Tolerances := [10,5,5,4];
if FindCharm('Green',Colors,Tolerances,1) then
begin
Mouse(X,Y,0,0,mouse_right);
if ChooseOption('ake Green') then
begin
StatusWithPaint('Picking up green charm.');
Inc(GreenCharms);
Report;
Wait(1000);
repeat until not IsMoving
Wait(500);
end;
end;

Colors := [6183977,8552249];
Tolerances := [10,10];
if FindCharm('Blue',Colors,Tolerances,1) then
begin
Mouse(X,Y,0,0,mouse_right);
if ChooseOption('ake Blue') then
begin
StatusWithPaint('Picking up blue charm.');
Inc(BlueCharms);
Report;
Wait(1000);
repeat until not IsMoving
Wait(500);
end;
end;

Colors := [3295859,2567297,3290481];
Tolerances := [8,8,10];
if FindCharm('Crimson',Colors,Tolerances,1) then
begin
Mouse(X,Y,0,0,mouse_right);
if ChooseOption('ake Crims') then
begin
StatusWithPaint('Picking up crimson charm.');
Inc(CrimsonCharms);
Report;
Wait(1000);
repeat until not IsMoving
Wait(500);
end;
end;

end;
end;



function WaitInFight(Timeout: Integer) : Boolean; //waits until Timeout or till we get into a fight (will return true in this case)
var
X,Y,XP1,XP2,ShieldDTM,Time : Integer;
begin
XP1 := GetXPBar(XPCounter);
MarkTime(Time);
ShieldDTM := DTMFromString('mQwAAAHicY2ZgYGBlYWAQAmIOIJZmZGCQAm J1IGax9mT4+/cvA9eCJwxcQHUwzIiEgQAAxXEFvA==');
repeat
XP2 := GetXPBar(XPCounter);
if (XP2 > XP1) then
begin
if DebugLines then
Writeln('XP is increased, we are fighting.');
if PaintDebug then
begin
SMART_DrawBoxEx(true,false,IntToBox(524,54,543,73) ,ClYellow);
Wait(100);
SMART_ClearCanvasArea(IntToBox(520,50,547,77));
end;
Result := True;
FreeDTM(ShieldDTM);
Exit;
end;
if (TimeFromMark(Time) > 3000) and FindDTM(ShieldDTM,X,Y,MSX1,MSY1,MSX2,MSY2) then //if xp is increased or shield dtm found (3000 seconds is for not the detect the blue shield of the previous fight)
begin
if DebugLines then
Writeln('Blue shield found, we are fighting.');
Result := True;
FreeDTM(ShieldDTM);
Exit;
end;
until (TimeFromMark(Time) > Timeout)
FreeDTM(ShieldDTM);
Result := False;
end;



function FindRedBar : Boolean;
var
X,Y,RedBarDTM : Integer;
begin
Result := False;
RedBarDTM := DTMFromString('mlwAAAHicY2dgYDBnZmCQBWIZKB0ExQpA3A iUr2OA0C1QDOPvZOBgsGZnwsBdDIwM+AAjHgwFAAvPB5w=');
if FindDTM(RedBarDTM,X,Y,MSX1,MSY1,MSX2,MSY2) then
begin
if DebugLines then
Writeln('Found redbar, we killed it.');
if PaintDebug then
begin
SMART_DrawBoxEx(true,false,IntToBox(X-30,Y-10,X+30,Y+10),ClYellow); //drawing box around the redbar
Wait(100);
SMART_ClearCanvasArea(IntToBox(MSX1,MSY1,MSX2,MSY2 ));
end;
Result := True;
end;
FreeDTM(RedBarDTM);
end;



procedure HopWorld;
var
FailTime : Integer;
begin
StatusWithPaint('Hopping.');
Inc(WorldHops);

MarkTime(FailTime);
repeat
ExitToLobby;
if TimeFromMark(FailTime) > 30000 then //sometimes RS crashes when going to lobby (black screen)
EndScript('Failed to exit to lobby when hopping.');
until LobbyScreen;

OpenWorldScreen;
SelectWorld(RandomWorld(true,false)); //member world, not pvp

MarkTime(FailTime);
repeat
LoginPlayer;
if TimeFromMark(FailTime) > 60000 then //sometimes RS crashes at login (black screen)
EndScript('Failed to login after hopping.');
until LoggedIn

Wait(RandomRange(500,6000));
ToggleXPBar(true);
SetAngle(SRL_ANGLE_HIGH);
end;



procedure WalkToCenter; //simple SPS walking to center (will improve in the future)
begin
StatusWithPaint('Walking to center.');
SPS_WalkToPos(Point(335, 374)); //no need randomness, because its not accurate
end;



procedure SpecialAttack;
var
X,Y,DTM100,DTM75,DTM60,DTM55,DTM50,DTM25,i,FailTim e : Integer;
begin
if UseSpecAttacks and ((TimeFromMark(SpecTime) > SpecWait) or (SpecNumber > 0)) then //will enter if specials are turned on AND (if its time to check for special OR we have remaining specials to do)
begin
StatusWithPaint('Checking special attack.');
DTM100 := DTMFromString('mWAAAAHicY2FgYHBgYmCwB+IjULyQkYFhHR AvAOI1QFyzIo9BSl+EwT/XkiGi2oGBC6gHGTOiYRAAAPnmCNY='); //DTMS for 100%,75% ... special bars
DTM75 := DTMFromString('mQwAAAHicY2ZgYLBnguAFIMzIwLAWiJcBsX OyIYOmpwJDep83AxdQHQwzImEgAAD6tQXo');
DTM60 := DTMFromString('mQwAAAHicY2ZgYHBgYmCwB+IuIF7EyMCwhh FCt2wuZTDyUmWYcKSegQuoDoYZkTAQAAAooAdH');
DTM55 := DTMFromString('mQwAAAHicY2ZgYGhmgeDjQCzNxMCgCcSyQO ycbMggpS/CMOFIPQMXUB0MMyJhIAAA5cgFbA==');
DTM50 := DTMFromString('mQwAAAHicY2ZgYHBgYmCwB+JaIF7EyMCwhh FCt2wuZTDyUmWYcKSegQuoDoYZkTAQAAAl1Qc6');
DTM25 := DTMFromString('mQwAAAHicY2ZgYHBgYmCwB+IoIF7EyMCwhh FCt2wuZTDyUmWYcKSegQuoDoYZkTAQAAAeUAcX');
SpecNumber := 0;
MarkTime(FailTime);
repeat
if (TimeFromMark(FailTime) > 5000) then Exit; //if failed to switch tabs, then it exits
GameTab(tab_Combat);
until (GetCurrentTab = tab_Combat)
SpecNumber := 0; //no matter if we have remaining specials to do, we will set it to 0 and determine it again
case SpecUsage of //determining how many specials we can do
100:
if FindDTM(DTM100,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
60:
if FindDTM(DTM60,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
55:
if FindDTM(DTM55,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
50:
begin
if FindDTM(DTM50,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
if FindDTM(DTM100,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 2;
end;
25:
begin
if FindDTM(DTM25,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
if FindDTM(DTM50,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 2;
if FindDTM(DTM75,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 3;
if FindDTM(DTM100,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 4;
end;
end;
MarkTime(SpecTime);
SpecWait := RandomRange(15000,60000); //next spec check in 15-60 seconds
if SpecNumber > 0 then //if we can spec
begin
StatusWithPaint('Using special attack.');
MouseBox(574,416,706,428,mouse_left);
Dec(SpecNumber);
end else //it cant do spec
begin
StatusWithPaint('Not enough special.');
Wait(RandomRange(500,4000));
StatusWithPaint('Back to fighting.');
MarkTime(FailTime);
repeat
if (TimeFromMark(FailTime) > 5000) then Exit;
GameTab(tab_Inv);
until (GetCurrentTab = tab_Inv)
end;
FreeDTM(DTM100);
FreeDTM(DTM75);
FreeDTM(DTM60);
FreeDTM(DTM55);
FreeDTM(DTM50);
FreeDTM(DTM25);
end;
end;



procedure LoginCheck;
begin
if not LoggedIn then
begin
StatusWithPaint('Logging in.');
if not LoginPlayer then
EndScript('We got logged out somehow and cant log in.');
end;
end;



procedure HpCheck;
var
colorstring, lobs, peaches : String;
FailTime, Amount : Integer;
done : Boolean;
begin
if (GetMMLevels('hp', colorstring) < EatAt) then
begin
MarkTime(FailTime);
repeat
if not b2p then //if not using B2P yet then we eat a simple food (lobster)
begin
StatusWithPaint('Eating lobster.');
Amount := 120; //healing amount for lobster
lobs := 'mggAAAHicY2NgYPjPxMDAzczAwMcMYX8E4p9ALMbIwMAKxNxA rMAI4fMC8f4EGaAuJgwsAiSxYUYcGAIAcgoGSA==';
if not EatFood(lobs) then
begin //if out of food
if not BonesToPeaches then //if not using B2P, then we log out
EndScript('Out of food.')
else
b2p := True; //lets start using B2P
end;
end;
if b2p then
begin
StatusWithPaint('Eating peaches.');
Amount := 80; //healing amount for peach
peaches := '78DA632C60626070626440069B3B52194480344C94310FA8C 60C550D030313AA9A32A01A0B026A6A806A1C08A8A906AA712 7A006E4663F026A52883007A4C69E809A4CC2FE0200D76708C 1'
if not EatFood(peaches) then //if out of peaches
begin
StatusWithPaint('Breaking B2P.');
if not BreakB2P then //if out of tablets
EndScript('Out of B2P tablets.');
if not EatFood(peaches) then //if broke tablet but cant eat peaches
EndScript('Failed to eat peaches after broking B2P.');
end;
end;
if (GetMMLevels('hp', colorstring) > (HpLevel * 10 - Amount)) or (TimeFromMark(FailTime) > 30000) then //if we no need to eat more (current hp > (maxhp - healamout)) (30 seconds timeout for fail safe)
done := True;
until done
end;
end;



procedure NoobCheck;
begin
if Length(GetMinimapDotsin('player',592,49,662,120)) > 0 then
begin
StatusWithPaint('Found a noob, waiting.');
MakeScreenShot('C:\Simba\Screenshots\ChaosMossKill er\noobs\');
Wait(RandomRange(5000,10000));
HopWorld;
end;
end;



function BonesCheck : Boolean;
var
LookedForBones : Integer;
begin
Result := False;
if BonesToPeaches then
begin //if using B2P then we need to collect bones
if not InvFull then
begin
LookedForBones := 0;
repeat
if FindBones(MSX1,MSY1,MSX2,MSY2) then
begin
StatusWithPaint('Picking up bones.');
Mouse(X,Y,0,0,mouse_right);
ChooseOptionCharms('ake Big');
Wait(1000);
repeat until not IsMoving
Result := True;
end;
Inc(LookedForBones);
until (InvFull) or (LookedForBones = 5) //looking for bones max 5 times (failsafe)
end;
end;
end;



procedure RandomsCheck;
begin
if FindNormalRandoms then
EndScript('Random event found!');
end;



procedure AmmoCheck; //function for Ranging
var
i : Integer;
done : Boolean;
begin
if LevelString = 'RNG' then
if FindChatBoxText('You have no ammo',8,ClBlack) then //ammo check
begin
StatusWithPaint('Out of ammo.');
Wait(1000);
if srl_inFight then
begin
StatusWithPaint('Still fighting, removing weapon.');
repeat until GameTab(tab_Inv)
if InvFull then
begin
i := 5;
done := False;
repeat
MMouseItem(i);
if IsUpTextMultiCustom(['Bury','ury','Eat','at']) then
begin
ClickMouse2(mouse_right);
if ChooseOptionMulti(['Drop','rop']) then
done := True;
end;
Inc(i);
until done
end;
repeat until GameTab(tab_Equip);
MouseBox(573,294,594,311,mouse_left);
StatusWithPaint('Removed weapon.');
EndScript('Out of ammo.');
end;

end;
end;



procedure SetupScript;
begin
ClearDebug;
Disguise('ChaosMossKiller Temp Fix By Mat');
Status('Starting script.');
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
Smart_Server := 24;
Smart_Members := Members;
Smart_Signed := Signed;
SMART_SuperDetail := False;
{$ELSE}
SmartPairClient(4440);
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
{$ENDIF}
SetupSRL;
ActivateClient;
DeclarePlayers;
SetupSRLStats(680, SRLStats_User, SRLStats_Password);
SPS_Setup(RUNESCAPE_OTHER,['chaos_tunnels']);
if PaintDebug then
SMART_ClearCanvas;
Status('Logging in.');
LoginPlayer;
end;



procedure Startup;
var
fails, FailTime : Integer;
done : Boolean;
begin
if srl_inFight then
begin
StatusWithPaint('Waiting till fight is over.');
repeat until not srl_InFight
end;

fails := 0;
done := True;
MarkTime(FailTime);
repeat
ToggleXPBar(True);
TrainedLevel := GetSkillLevel(TrainedSkill);
if (TrainedLevel = -1) then
begin
done := False;
fails := fails+1;
end;
HpLevel := GetSkillLevel('Hitpoints');
if (HpLevel = -1) then
begin
done := False;
fails := fails+1;
end;
StartXPtillNext := XPTillNextLevel(TrainedSkill);
if (StartXPtillNext = -1) then
begin
done := False;
fails := fails+1;
end;
StartXP := GetXPBar(XPCounter);
if (StartXP = -1) then
begin
done := False;
fails := fails+1;
end;
if (fails = 3) or (TimeFromMark(FailTime) > 30000) then
EndScript('Startup fail. Cant get level/read xps.');
until done

case TrainedSkill of
'Attack' : LevelString := 'ATK';
'Strength' : LevelString := 'STR';
'Defence' : LevelString := 'DEF';
'Range' : LevelString := 'RNG';
end;

case DebugLines of
true: doreport := False;
false: doreport := True;
end;

b2p := False;
LastXP := 0;
WorldHops := 0;
B2PUsed := 0;
FoodUsed := 0;
GoldCharms := 0;
GreenCharms := 0;
BlueCharms := 0;
CrimsonCharms := 0;

if UseSpecAttacks then
begin
SpecNumber := 0;
SpecWait := RandomRange(15000,45000);
MarkTime(SpecTime);
end;

ClearDebug;
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~');
WriteLn(' ChaosMossKiller Temp Fix By Mat ' + Version);
WriteLn(' - HP level : ' + IntToStr(HpLevel));
Writeln(' - ' + LevelString + ' level : ' + IntToStr(TrainedLevel));
Writeln(' - XP till next : ' + IntToStr(StartXPtillNext));
Writeln(' - XP Bar : ' + IntToStr(StartXP));
WriteLn(' - Starting script...');
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~');

MarkTime(StartTime);
SetAngle(SRL_ANGLE_HIGH);
end;



procedure Main;
var
DetectTime, KillTime : Integer;
done : Boolean;
begin
repeat

StatusWithPaint('Looking for Mosses.');
done := False;
MarkTime(DetectTime);
repeat
if (TimeFromMark(DetectTime) > 180000) then //180 seconds failsafe
EndScript('Cant find Mosses.');
if FindMoss(true) then //if clicked on moss
begin
if WaitInFight(4000) then //checking if we are fighting
done:=True
end else
begin //if failed to attack moss
StatusWithPaint(IntToStr(TimeFromMark(DetectTime)) +'ms');
case Random(20) of
0: CompassMovement(-120,120,false); //rotating camera for better view
end;
LoginCheck;
RandomsCheck;
if (TimeFromMark(DetectTime) > 10000) then //walking back to middle
WalkToCenter;
end;
until done //we are fighting now


StatusWithPaint('Fighting.');
MarkTime(KillTime);
repeat
Antiban;
AmmoCheck;
if (TimeFromMark(KillTime) < 5000) then //we dont want to waste special attack, so we only using it in the first 5 seconds
SpecialAttack;
if ((TimeFromMark(KillTime) > 5000) and (FindRedBar)) then //we are looking for redbar after 5 seconds of fighting
Break; //end of fight
Wait(500);
until ((TimeFromMark(KillTime) > 10000) and (not srl_inFight)) //failsafe is: 10 seconds and no hpbar above the player -> end of fight


StatusWithPaint('Killed Moss. Took '+MsToTime(TimeFromMark(KillTime),Time_Formal)+'.' );
Report;
stats_Commit; //committing stats (no variebles yet, only time)
BonesCheck; //this will look for bones if needed and pickst them up
FindAllCharms; //this will look for charms and picks them up
LoginCheck;
NoobCheck; //this will look for other players around
HpCheck; //this will check hp and eat (use b2p) if needed

until False
end;



begin

SetupScript;
Startup;
Main;

end.

This Complie so it should work unless RS Changed Anything.
Mat

Thanks man. You deserve some +rep!

Mat
08-01-2012, 10:26 AM
@Moj I didn't change any Logic :P I just made it work with Smart 7.2 and Simba 991.
Mat And Thanks Law and Justice <3

Shatterhand
08-05-2012, 08:06 PM
Im back, just got Simba working after like 4 weeks. Awesome! :D
By the way I dont have member account atm, if you guys could tell me the compile errors, problems or lend me an account... :)
Right now Im trying to fix my f2p bonfire script, with new simba 991 and smart 7.2.

bomzene
08-05-2012, 08:33 PM
Im back, just got Simba working after like 4 weeks. Awesome! :D
By the way I dont have member account atm, if you guys could tell me the compile errors, problems or lend me an account... :)
Right now Im trying to fix my f2p bonfire script, with new simba 991 and smart 7.2.

The issues I have:

1. For some reason on some lower level accounts the bot would just keep eating a peach then breaking another tab after it looted about 3 more bones. The script then stops and the error message that comes up says something about the bot could not eat the peach after the tab was broken.

The reason I mentioned that they are low level is because I have two higher level accounts that the mossies do not attack, they seem to run fine with no errors, except one (will discuss further on).

2. With the new 6 hour logout and restart feature built into Simba, the script doesn't seem to be compatible and stops because and gives me the message, Error, we have logged out for some reason and cannot log back in < something like that, then the script stops.

Hopefully these errors are not too hard to fix, thanks for a great script and thanks to Mat for the temp fix.

Mjordan
08-05-2012, 09:02 PM
I don't have any issues with Mat's fix at all if my internet is good. I'm lvl 122 and using b2p, or a bonecrusher sometimes. If you get it working with the new simba/smart it should be good to go.

@bomzene, your 6 hour restart problem is due to the stupid RS error when it says that 'your account has not logged out from its previous session'.

Shatterhand
08-05-2012, 10:05 PM
@bomzene, your 6 hour restart problem is due to the stupid RS error when it says that 'your account has not logged out from its previous session'.
I think you are right, I know no ways to solve that.
Anyway the script checks if we are logged in with LoginCheck function. An easy repeat-until with timeout is good, it will let smart have some time to load up.

Mjordan
08-06-2012, 12:06 AM
I think you are right, I know no ways to solve that.
Anyway the script checks if we are logged in with LoginCheck function. An easy repeat-until with timeout is good, it will let smart have some time to load up.

I watched mine restart perfectly and run for about 11 hours total using the SRL restart function. Then another time I watched the script quit because of the 'account already logged in' error. So I'm 110% sure that's the problem. A repeat or something like you said should fix it.

Oh yeah, the paint is not in the correct place because of the navigation bar update, but that's just simple coordinate changes.

Other then that everything seems to be working just like always after I added a small random wait right before the fight check (for my slow internetz).

Shatterhand
08-06-2012, 07:51 AM
I watched mine restart perfectly and run for about 11 hours total using the SRL restart function. Then another time I watched the script quit because of the 'account already logged in' error. So I'm 110% sure that's the problem. A repeat or something like you said should fix it.

Oh yeah, the paint is not in the correct place because of the navigation bar update, but that's just simple coordinate changes.

Other then that everything seems to be working just like always after I added a small random wait right before the fight check (for my slow internetz).
The 'account already logged in' error terminates the script I think...

bweibking
08-09-2012, 08:58 PM
will u be updating this with new simba and smart?

Shatterhand
08-09-2012, 09:30 PM
will u be updating this with new simba and smart?
I dont have any members account. I need someone to lend me for some hours or so.
Fixing the things blindly isnt that good, I dont wanna release a buggy update.

mrbarrybadger
08-14-2012, 09:37 PM
Guys Can You Please Help Me I Get This Error
[Error] C:\Simba\Includes\srl/srl/misc/smart.simba(53:19): Invalid number of parameters at line 52
Compiling failed

Spenser171
08-15-2012, 05:52 AM
i am getting the exact same problem as mrbarrybadger

Leonardo Da Vinci
08-15-2012, 05:59 AM
Guys Can You Please Help Me I Get This Error
[Error] C:\Simba\Includes\srl/srl/misc/smart.simba(53:19): Invalid number of parameters at line 52
Compiling failed

Just use this one.


Hey Peepz Try this:

program ChaosMossKillerTempFixMat;
{$DEFINE SMART}
{$include_once SRL/SRL.simba}
{$include_once SPS/SPS.simba}
{$include_once SRL/SRL/Misc/Debug.simba}
{$include_once SRL/SRL/core/animation.simba}
{$include_once SRL/SRL/skill/magic.simba}
{$IFDEF SIMBAMAJOR980}
{$I SRL/SRL/Misc/PaintSmart.Simba} {$ELSE}
{$I SRL/SRL/Misc/SmartGraphics.Simba}
{$ENDIF}
const
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
//========================ChaosMossKiller by hunt3rx3=======================v6.0
//READ THESE CAREFULLY!======================================== ===========19 May
//*YOU MUST SET UP XP COUNTER FOR TRAINED LEVEL, OTHERWISE SCRIPT WONT WORK!====
//*FOOD:============================================ ============================
// -ONLY EATS LOBSTERS AND PEACHES=========================================== ==
// -DONT USE B2P WITH BONECRUSHER! COMMON SENSE================================
//*CHARM LOOTING:========================================== =====================
// -WILL PICK UP CHARMS WHAT YOU CAN SEE WITH YOUR EYES!=======================
// -WONT RIGHT CLICK ALL THE LOOT PILES!=======================================
// -HAVE 1+ OF EACH AT START!============================================ ======
//*SPECIAL ATTACKS:========================================== ===================
// -ONLY PRIMARY WORN WEAPONS, WONT SWITCH WEAPONS!============================
// -KORASI NOT SUPPORTED! WOULD MESS UP THE SCRIPT!============================
//================================================== ============================
SRLStats_User = ''; // Your SRL Stats ID (If you dont have one then just leave it as it is)
SRLStats_Password = ''; // Your SRL Stats Password (If you dont have one then just leave it as it is)

Username = '';
Password = '';

TrainedSkill = 'Strength'; // Attack, Strength, Defence, Range
XPCounter = 2; // 1,2,3
EatAt = 700; // 100-999

BonesToPeaches = True;
PickUpCharms = True;

UseSpecAttacks = False; // Only worn weapons. Not supported: Korasi.
SpecUsage = 55; // Spec usage of worn weapon. Supported: 25, 50, 55, 60, 100

PaintStatus = True; // set Private Chat off for this
PaintDebug = True;

TakeScreenShots = True; // (~100 kb jpeg, wont eat memory)
ScreenShotsPath = 'C:\Simba\Screenshots\ChaosMossKiller\';


DebugWindow = False;
DebugLines = False;
//================================================== ============================
//===========UPDATES: http://villavu.com/forum/showthread.php?t=74029===========
//================================================== ============================
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Version = 'v6.0';


var
X, Y: Integer;
StartTime, StartXp, StartXPtillNext, TrainedLevel, HpLevel : Integer;
WorldHops, B2PUsed, FoodUsed, GoldCharms, GreenCharms, BlueCharms, CrimsonCharms : Integer;
SpecWait, SpecTime, SpecNumber : Integer;
LastXP : Extended;
LevelString : String;
doreport, b2p : Boolean;



procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
with Players[0] do
begin
Name := UserName;
Pass := Password;
Active := True;
end;
end;



procedure MakeScreenShot(const FilePath : String); //example: 'C:\Simba\Screenshots\ChaosMossKiller\levelups'
var
fileName : String;
Year, Month, Day : Word;
i : Integer;
begin
if TakeScreenShots then
begin
if not DirectoryExists(ScreenShotsPath) then
CreateDirectory(ScreenShotsPath);
if not DirectoryExists(FilePath) then
CreateDirectory(FilePath);
DecodeDate(Date,Year,Month,Day);
i := 0;
repeat
i := i+1;
FileName := ToStr(Year) + '-' + ToStr(Month) + '-' + ToStr(Day) + ' (' + IntToStr(i) + ').jpg';
until not FileExists(FilePath + FileName)
SaveScreenShot(FilePath + FileName); //example: 2012-3-21 (1).jpg
end;
end;



procedure OpenDebugWindow(TPA: TPointArray; ATPA: array Of TPointArray; PaintBox: Boolean; Box: TBox); //box is for the dying Moss giant
var
BMP, x,y, i, Color : Integer;
TPABox: TBox;
begin
BMP := BitmapFromClient(0,0,MSX2,MSY2); //making a bitmap, adding the mainscreen image to it
DrawTPABitmap(BMP,TPA,clRed); //adding TPA to the bitmap

for i := 0 to high(ATPA) do
begin
if i = 0 then
Color := clYellow
else
Color := clBlack;

TPABox := getTPABounds(ATPA[i]); //getting the box of the TPA
for x := TPABox.x1 to TPABox.x2 do
begin
FastSetPixel(BMP, x, TPABox.y1, Color) //drawing lines
FastSetPixel(BMP, x, TPABox.y2, Color) //drawing lines
end;
for y := TPABox.y1 to TPABox.y2 do
begin
FastSetPixel(BMP, TPABox.x1, y, Color) //drawing lines
FastSetPixel(BMP, TPABox.x2, y, Color) //drawing lines
end;
end;

if PaintBox then //this is for the dying Moss giant
begin
for x := Box.x1 to Box.x2 do
begin
FastSetPixel(BMP, x, Box.y1, ClRed) //drawing lines
FastSetPixel(BMP, x, Box.y2, ClRed) //drawing lines
end;
for y := Box.y1 to Box.y2 do
begin
FastSetPixel(BMP, Box.x1, y, ClRed) //drawing lines
FastSetPixel(BMP, Box.x2, y, ClRed) //drawing lines
end;
end;
DebugBitmap(BMP);
FreeBitmap(BMP);
end;



function CurrentTime: string; //function for time, example [17:53:59]
var
Hour, Mins, Sec, MSec: Word;
begin
DecodeTime(Now, Hour, Mins, Sec, MSec);
Result := ('['+Padz(IntToStr(Hour), 2) + ':' + Padz(IntToStr(Mins), 2) + ':' + Padz(IntToStr(Sec), 2)+'] ');
end;



procedure EndScript(Reason : String); //function for ending, message box will pop up
begin
MakeScreenShot(ScreenShotsPath + 'stops\');
Disguise('Stopped');
Writeln(CurrentTime + Reason);
MessageBox(CurrentTime + Reason,'ChaosMossKiller Temp Fix By Mat',0); //message box as warning
TerminateScript;
end;



procedure StatusWithPaint(What : String); //Painting status on SMART
begin
Status(What);
if PaintStatus then
begin
SMART_ClearCanvasArea(IntToBox(MSX1,320,MSX2,343)) ;
SMART_DrawTextEx(False,8,322,SmallChars,What,ClWhi te); //drawing the text
end;
end;



procedure Report;
var
XP, XPHour, PrayXP, XPtillNext, TimeRun : Extended; //i have no clue why, but integer with Round() wont work
done : Boolean;
fails : Integer;
begin
if not DoReport then Exit;
fails := 0;
done := True;
repeat //reading XPCounter for xp gained
if (fails = 5) then
begin
Writeln(CurrentTime+'Failed to read XPBar. Turning off Reports.');
DoReport := False;
Exit;
end;
XP := GetXPBar(XPCounter)-StartXP;
if (XP + StartXP = -1) then //if fails to read xpbar it gives -1
begin
done := False;
fails := fails+1;
end;
until done

TimeRun := TimeFromMark(StartTime);
PrayXP := Round(XP / 240 * 15);
XPHour := Round(XP * (3600000 / TimeRun));
XPtillNext := StartXPtillNext - XP + LastXP; //LastXP = 0 untill we get a levelup

if (XPtillNext < 0) then //levelup check
begin
fails := 0;
done := True;
repeat //getting new level and xp till next
if (fails = 5) then
begin
Writeln(CurrentTime + 'Failed to get level/XPs. Turning off Reporting.');
DoReport := False;
Exit;
end;
TrainedLevel := GetSkillLevel(TrainedSkill);
if (TrainedLevel = -1) then //if fails to get level it gives -1
begin
done := False;
fails := fails+1;
end;
StartXPtillNext := XPTillNextLevel(TrainedSkill);
if (StartXPtillNext = -1) then //if fails to read xp it gives -1
begin
done := False;
fails := fails+1;
end;
until done

XPtillNext := StartXPtillNext;
LastXP := Round(XP); //we store the 'xp gained till now' (round is needed cause extended and integer)
MakeScreenShot(ScreenShotsPath + 'levelups\'); //this will make a screenshot of our levelup:)
Wait(RandomRange(3000,5000));
end;

ClearDebug;
Disguise('ChaosMossKiller [' + FloatToStr(XPHour) + ']');
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~');
WriteLn(' ChaosMossKiller ' + Version);
WriteLn(' * Time Running: ' + MsToTime(Round(TimeRun),Time_Formal));
WriteLn(' * ' + LevelString + ' XP Gained: ' + FloatToStr(XP) + ' (' + FloatToStr(XPHour) + ')');
Writeln(' * ' + LevelString + ' Level: ' + IntToStr(TrainedLevel) + ', XP till next: ' + FloatToStr(XPtillNext));
Writeln(' * B2P: ' + IntToStr(B2PUsed) + ' Food: ' + IntToStr(FoodUsed))
if PickUpCharms then
Writeln(' * Charms: ' + IntToStr(GoldCharms) + '/' + IntToStr(GreenCharms) + '/' + IntToStr(BlueCharms) + '/' + IntToStr(CrimsonCharms))
else
Writeln(' * Not picking up charms.');
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~');
end;



procedure Antiban; //basic antibans
begin
case Random(2400) of
1..2:
begin
StatusWithPaint('Checking trained level.');
TrainedLevel := GetSkillLevel(TrainedSkill);
HoverSkill(TrainedSkill,false);
Wait(RandomRange(1000,3000));
GameTab(tab_Inv);
StatusWithPaint('Back to fighting.');
end;
3..4:
begin
StatusWithPaint('Checking hp level.');
TrainedLevel := GetSkillLevel(TrainedSkill);
HoverSkill(SKILL_HITPOINTS,false);
Wait(RandomRange(1000,3000));
GameTab(tab_Inv);
StatusWithPaint('Back to fighting.');
end;
5..6:
begin
StatusWithPaint('Checking random level.');
TrainedLevel := GetSkillLevel(TrainedSkill);
HoverSkill('random',false);
Wait(RandomRange(1000,3000));
GameTab(tab_Inv);
StatusWithPaint('Back to fighting.');
end;
7..8: PickUpMouse;
9..14: CompassMovement(-180,180,false);
180..460: SleepAndMoveMouse(RandomRange(300,1200));
end;
end;



function BreakB2P : Boolean;
var
TabDTM : Integer;
fails : Integer;
done : Boolean;
begin
TabDTM := DTMFromString('78DA633CC4C4C070899101194CEEED65F80 2148289326E03AA398BAA868181894184014DCD0D026AF602D 53C20A0E614116A2E01D55C2742CD79FC6A00BDB80E80');
if not (GetCurrentTab = tab_Inv) then
GameTab(tab_Inv);
Wait(RandomRange(200,400));
fails := 0;
done := False;
repeat
if FindDTM(TabDTM,X,Y,MIX1,MIY1,MIX2,MIY2) then
begin
Mouse(X,Y,5,5,mouse_left); //clickig on B2P tab
Inc(B2PUsed);
Wait(RandomRange(6000,8000)); //it takes long to break it
Result := True;
done := True;
end else
begin
if not (GetCurrentTab = tab_Inv) then //sometimes it fails to switch tabs for the first time
GameTab(tab_Inv);
fails := fails+1;
end;
if (fails = 5) then //trying to find DTM 5 times max
begin
Result := False;
done := True;
end;
until done
FreeDTM(TabDTM);
end;



function EatFood(var foodDTMString : String): boolean;
var
FoodDTM, EatTime, CurrentHP, fails : Integer;
done : Boolean;
colorstring : String; //this is for a return value, not using it
begin
FoodDTM := DTMFromString(foodDTMString);
if not (GetCurrentTab = tab_Inv) then
GameTab(tab_Inv);
Wait(RandomRange(200,400));

fails := 0;
done := False;
repeat
if FindDTM(FoodDTM,X,Y,MIX1,MIY1,MIX2,MIY2) then
begin
CurrentHP := GetMMLevels('hp', colorstring);
MarkTime(eatTime);
repeat
MultiMouse(X,Y,80,2,true);
Wait(RandomRange(400,800));
if ( GetMMLevels('hp', colorstring) > (CurrentHP + 30) ) then //checking if HP is increased
begin
Inc(FoodUsed);
done := True;
Result := True;
end;
if (TimeFromMark(eatTime) > 10000) then
begin
Result := False;
done := True;
end;
until done
end
else
begin
if not (GetCurrentTab = tab_Inv) then //sometimes it fails to switch tabs for the first time
GameTab(tab_Inv);
fails := fails+1;
Wait(500);
end;

if (fails = 5) then //trying to find DTM max 5 times
begin
Result := False;
done := True;
end;
until done
FreeDTM(FoodDTM);
end;



function ChooseOptionCharms(What : String) : Boolean; //modified SRL function, this will loot charms if possible
var
B: TBox;
i, H, x: Integer;
T: TPoint;
Options: Array of TOptions;
begin
Result := False;
Options := GetChooseOptions('action');
if (Length(Options) < 1) then
Exit;
H := High(Options);

for i := 0 to H do
begin
if PickUpCharms then //if charms looting is enabled
begin
if Pos('ake Gold', Options[i].Str) > 0 Then
begin
StatusWithPaint('Found a Gold charm!');
Inc(GoldCharms);
Report;
Result := True;
B := Options[i].Bounds;
GetMousePos(T.x, T.y);
if PointInBox(T, B) then
ClickMouse2(true)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Exit;
end;

if Pos('ake Green', Options[i].Str) > 0 Then
begin
StatusWithPaint('Found a Green charm!');
Inc(GreenCharms);
Report;
Result := True;
B := Options[i].Bounds;
GetMousePos(T.x, T.y);
if PointInBox(T, B) then
ClickMouse2(true)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Exit;
end;

if Pos('ake Blue', Options[i].Str) > 0 Then
begin
StatusWithPaint('Found a Blue charm!');
Inc(BlueCharms);
Report;
Result := True;
B := Options[i].Bounds;
GetMousePos(T.x, T.y);
if PointInBox(T, B) then
ClickMouse2(true)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Exit;
end;

if Pos('ake Crims', Options[i].Str) > 0 Then
begin
StatusWithPaint('Found a Crimson charm!');
Report;
Inc(CrimsonCharms);
Result := True;
B := Options[i].Bounds;
GetMousePos(T.x, T.y);
if PointInBox(T, B) then
ClickMouse2(true)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Exit;
end;
end;

if Pos(What, Options[i].Str) > 0 Then //this will check for 'attack' or 'take bones' (nowhere else using ChooseOptionCharms)
begin
Result := True;
B := Options[i].Bounds;
GetMousePos(T.x, T.y);
if PointInBox(T, B) then
ClickMouse2(true)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Exit;
end;
end;

B := Options[0].BigBox; //to mmouse away
x := Max(B.X1 - 52, 0);
if x = 0 then
x := B.X2+10;
MMouse(x, Max(B.Y1 - 50, 0), 40, B.Y2-B.Y1);
Wait(200 + Random(100));
end;



function FindMoss(ClickOnIt: Boolean) : Boolean; //returns true only if clicked on a Moss giant
var
RedX, RedY, ExcX, ExcY, i, MinPoints, DetectTime, UptextTime, RedHpBarDTMTime, RedHpBarDTM : Integer;
TPA, MossTPA : TPointArray;
ATPA : Array of TPointArray;
MossColors, Tolerances : Array of Integer;
ExcludeNearRedHpBar : Boolean;
begin
Result := False;
MarkTime(DetectTime);
//6257521 (8) portal színe, tökéletes
//2173227 (5) nincs már sötét fal (eddig 7 jó volt)
//2372406 (8) nincs már (12 volt) nagyon kicsi barna fából
//2309694 (7) nincs nagyon nagyon kicsi barna fából
//3303025 (14) sárgásbarna, tökéletes
//4482405 (13)
MossColors := [6257521, 2173227, 2372406, 2309694, 3303025, 4482405];
Tolerances := [8, 5, 8, 7, 15, 13];
MinPoints := 200;

for i:=0 to High(MossColors) do
begin
FindColorsTolerance(MossTPA,MossColors[i],MSX1,MSY1,MSX2,MSY2,Tolerances[i]);
AppendTPA(TPA,MossTPA);
end;

ExcludeNearRedHpBar := False;
RedHpBarDTM := DTMFromString('mWAAAAHicY2FgYNgCxOeh+AIQRwFxOBDHQt k7GTgYrNmZ4FgEKIaMGdEwCAAAoEoGcA==');
if WaitFindDTMex(RedHpBarDTM,X,Y,MSX1,MSY1,MSX2,MSY2, 10,100) then //if found redbar then we will exclude points around it
begin
ExcludeNearRedHpBar := True;
RedX := X;
RedY := Y+50;
ExcX := 35;
ExcY := 60;
end;
FreeDTM(RedHpBarDTM);

if (High(TPA)> 0) then
begin

if ExcludeNearRedHpBar then //excluding near RedHpBar
begin
SortTPAFrom(TPA,Point(redX,redY));
InvertTPA(TPA);
for i:=0 to High(TPA) do
if (Abs(TPA[i].x - RedX) < ExcX) and (Abs(TPA[i].y - RedY) < ExcY) then
Break;
SetArrayLength(TPA,i);
end;

SortTPAFrom(TPA,Point(MSCX,MSCY)); //excluding points near middle
InvertTPA(TPA);
for i:=0 to High(TPA) do
if (Abs(TPA[i].x - MSCX) < 25) and (Abs(TPA[i].y - MSCY) < 25) then
Break;
SetArrayLength(TPA,i);

ATPA := SplitTPA(TPA,10); //splitting TPAs

SortATPASize(ATPA,True); //excluding TPAs with less than MinPoints points
for i:=0 to High(ATPA) do
begin
if High(ATPA[i]) < MinPoints then
Break;
end;
if i = 0 then Inc(i);
SetArrayLength(ATPA,i);

SortATPAFromFirstPoint(ATPA,Point(MSCX,MSCY)); //making the closest TPA the first in the array


if DebugWindow then //DebugWindow
OpenDebugWindow(TPA,ATPA,true,IntToBox(RedX-ExcX,RedY-ExcY,RedX+ExcX,RedY+ExcY));

if High(ATPA[0]) < MinPoints then //to avoid errors
Exit;


if ClickOnIt then
begin
if MiddleTPAEx(ATPA[0],X,Y) then //getting the middle point of the TPA, moving mouse there then looking for uptext
begin
MMouse(X,Y,0,0);
MarkTime(UptextTime);
if WaitUpText('ttack',200) then
begin
if DebugLines then //DebugLines
Writeln('Found Moss in ' + IntToStr(TimeFromMark(DetectTime)) + ' ms. Uptext was ' + IntToStr(TimeFromMark(UptextTime)) + ' ms.');
case Random(6) of //random left or rigth click (5:1)
0..4:
begin
ClickMouse2(mouse_left);
if DidRedClick then
Result := True; //returns true = clicked on moss
Exit;
end;
5:
begin
ClickMouse2(mouse_right);
if ChooseOption('ttack') then
Result := True; //returns true = clicked on moss
Exit;
end;
end;
end else
if DebugLines then //DebugLines
Writeln('Found Moss in ' + IntToStr(TimeFromMark(DetectTime)) + ' ms, but failed to find UpText.');
end;
end; //PaintDebug: clearing the drawings on SMART
end;
end;



function FindBones(X1,X2,X3,X4: Integer) : Boolean; //returns true if uptext is 'Take'
var
TPA : TPointArray;
ATPA : Array of TPointArray;
i : Integer;
MinPoints, xmid, ymid : Integer;
begin
MinPoints := 50;
FindColorsTolerance(TPA,11975103,X1,X2,X3,X4,25);

SortTPAFrom(TPA,Point(MSCX,MSCY)); //excluding points near middle
InvertTPA(TPA);
for i:=0 to High(TPA) do
if (Abs(TPA[i].x - MSCX) < 20) and (Abs(TPA[i].y - MSCY) < 25) then
Break;
SetArrayLength(TPA,i);

if (High(TPA)> 0) then
begin

ATPA := SplitTPA(TPA,10); //splitting the TPA

SortATPASize(ATPA,True); //excluding TPAs with less than MinPoints points
for i:=0 to High(ATPA) do
begin
if High(ATPA[i]) < MinPoints then
Break;
end;
if i = 0 then Inc(i);
SetArrayLength(ATPA,i);

if DebugWindow then //DebugWindow
OpenDebugWindow(TPA,ATPA,false,IntToBox(0,0,0,0));

if (High(ATPA[0]) < MinPoints) then //to avoid errors
Exit;

if MiddleTPAEx(ATPA[0],xmid,ymid) then //getting the middle point of the TPA, moving mouse there then looking for uptext
begin
MMouse(xmid,ymid,0,0);
Wait(100);
if IsUpTextEx('ake') then
begin
Result := True; //returning true
GetMousePos(X,Y);
Exit;
end;
end;
end;
Result := False;

end;



function FindCharm(Which: String; Colors, Tolerances: TIntegerArray; MinPoints: Integer) : Boolean; //returns true if uptext is 'Take'
var
TPA, CharmTPA : TPointArray;
ATPA : Array of TPointArray;
i : Integer;
xmid, ymid : Integer;
begin
for i:=0 to High(Colors) do
begin
FindColorsTolerance(CharmTPA,Colors[i],MSX1,MSY1,MSX2,MSY2,Tolerances[i]);
if DebugLines then //DebugLines
if (High(CharmTPA) > 0) then
Writeln('[Charms] Found ' + IntToStr(High(CharmTPA)) + ' pixels for Color: ' +IntToStr(Colors[i]) + '. Tolerance is: ' + IntToStr(Tolerances[i]));
AppendTPA(TPA,CharmTPA);
end;

SortTPAFrom(TPA,Point(MSCX,MSCY)); //excluding poinst near middle
InvertTPA(TPA);
for i:=0 to High(TPA) do
if (Abs(TPA[i].x - MSCX) < 30) and (Abs(TPA[i].y - MSCY) < 30) then
Break;
SetArrayLength(TPA,i);


if (High(TPA)> 0) then
begin
ATPA := SplitTPA(TPA,15); //splitting the TPA

SortATPASize(ATPA,True);

if High(ATPA[0]) < MinPoints then //getting only the biggest TPA (it everything is fine, this function wont find any extra pixels)
Exit;

if DebugWindow then //DebugWindow
OpenDebugWindow(TPA,ATPA,false,IntToBox(0,0,0,0));

if MiddleTPAEx(ATPA[0],xmid,ymid) then //getting the middle of the TPA, moving mouse there then looking for uptext
begin
MMouse(xmid,ymid,0,0);
Wait(100);
if PaintDebug then
SMART_ClearCanvasArea(IntToBox(MSX1,MSY1,MSX2,MSY2 ));
if IsUpTextEx('ake') then
begin
Result := True; //returning true
GetMousePos(X,Y);
Exit;
end;
end;
end;
Result := False;
end;



procedure FindAllCharms; //this will call the FindCharm() for all the charms with the given parameters
var
Colors, Tolerances : Array of Integer;
begin
if PickUpCharms then //if charms enabled
begin
StatusWithPaint('Looking for charms.');

Colors := [5804446,5935011,5344659,5735582,5472916];
Tolerances := [10,10,10,10,10];
if FindCharm('Gold',Colors,Tolerances,1) then
begin
Mouse(X,Y,0,0,mouse_right);
if ChooseOption('ake Gold') then
begin
StatusWithPaint('Picking up gold charm.');
Inc(GoldCharms);
Report;
Wait(1000);
repeat until not IsMoving
Wait(500);
end;
end;

Colors := [5010263,6982265,5471587,5730659];
Tolerances := [10,5,5,4];
if FindCharm('Green',Colors,Tolerances,1) then
begin
Mouse(X,Y,0,0,mouse_right);
if ChooseOption('ake Green') then
begin
StatusWithPaint('Picking up green charm.');
Inc(GreenCharms);
Report;
Wait(1000);
repeat until not IsMoving
Wait(500);
end;
end;

Colors := [6183977,8552249];
Tolerances := [10,10];
if FindCharm('Blue',Colors,Tolerances,1) then
begin
Mouse(X,Y,0,0,mouse_right);
if ChooseOption('ake Blue') then
begin
StatusWithPaint('Picking up blue charm.');
Inc(BlueCharms);
Report;
Wait(1000);
repeat until not IsMoving
Wait(500);
end;
end;

Colors := [3295859,2567297,3290481];
Tolerances := [8,8,10];
if FindCharm('Crimson',Colors,Tolerances,1) then
begin
Mouse(X,Y,0,0,mouse_right);
if ChooseOption('ake Crims') then
begin
StatusWithPaint('Picking up crimson charm.');
Inc(CrimsonCharms);
Report;
Wait(1000);
repeat until not IsMoving
Wait(500);
end;
end;

end;
end;



function WaitInFight(Timeout: Integer) : Boolean; //waits until Timeout or till we get into a fight (will return true in this case)
var
X,Y,XP1,XP2,ShieldDTM,Time : Integer;
begin
XP1 := GetXPBar(XPCounter);
MarkTime(Time);
ShieldDTM := DTMFromString('mQwAAAHicY2ZgYGBlYWAQAmIOIJZmZGCQAm J1IGax9mT4+/cvA9eCJwxcQHUwzIiEgQAAxXEFvA==');
repeat
XP2 := GetXPBar(XPCounter);
if (XP2 > XP1) then
begin
if DebugLines then
Writeln('XP is increased, we are fighting.');
if PaintDebug then
begin
SMART_DrawBoxEx(true,false,IntToBox(524,54,543,73) ,ClYellow);
Wait(100);
SMART_ClearCanvasArea(IntToBox(520,50,547,77));
end;
Result := True;
FreeDTM(ShieldDTM);
Exit;
end;
if (TimeFromMark(Time) > 3000) and FindDTM(ShieldDTM,X,Y,MSX1,MSY1,MSX2,MSY2) then //if xp is increased or shield dtm found (3000 seconds is for not the detect the blue shield of the previous fight)
begin
if DebugLines then
Writeln('Blue shield found, we are fighting.');
Result := True;
FreeDTM(ShieldDTM);
Exit;
end;
until (TimeFromMark(Time) > Timeout)
FreeDTM(ShieldDTM);
Result := False;
end;



function FindRedBar : Boolean;
var
X,Y,RedBarDTM : Integer;
begin
Result := False;
RedBarDTM := DTMFromString('mlwAAAHicY2dgYDBnZmCQBWIZKB0ExQpA3A iUr2OA0C1QDOPvZOBgsGZnwsBdDIwM+AAjHgwFAAvPB5w=');
if FindDTM(RedBarDTM,X,Y,MSX1,MSY1,MSX2,MSY2) then
begin
if DebugLines then
Writeln('Found redbar, we killed it.');
if PaintDebug then
begin
SMART_DrawBoxEx(true,false,IntToBox(X-30,Y-10,X+30,Y+10),ClYellow); //drawing box around the redbar
Wait(100);
SMART_ClearCanvasArea(IntToBox(MSX1,MSY1,MSX2,MSY2 ));
end;
Result := True;
end;
FreeDTM(RedBarDTM);
end;



procedure HopWorld;
var
FailTime : Integer;
begin
StatusWithPaint('Hopping.');
Inc(WorldHops);

MarkTime(FailTime);
repeat
ExitToLobby;
if TimeFromMark(FailTime) > 30000 then //sometimes RS crashes when going to lobby (black screen)
EndScript('Failed to exit to lobby when hopping.');
until LobbyScreen;

OpenWorldScreen;
SelectWorld(RandomWorld(true,false)); //member world, not pvp

MarkTime(FailTime);
repeat
LoginPlayer;
if TimeFromMark(FailTime) > 60000 then //sometimes RS crashes at login (black screen)
EndScript('Failed to login after hopping.');
until LoggedIn

Wait(RandomRange(500,6000));
ToggleXPBar(true);
SetAngle(SRL_ANGLE_HIGH);
end;



procedure WalkToCenter; //simple SPS walking to center (will improve in the future)
begin
StatusWithPaint('Walking to center.');
SPS_WalkToPos(Point(335, 374)); //no need randomness, because its not accurate
end;



procedure SpecialAttack;
var
X,Y,DTM100,DTM75,DTM60,DTM55,DTM50,DTM25,i,FailTim e : Integer;
begin
if UseSpecAttacks and ((TimeFromMark(SpecTime) > SpecWait) or (SpecNumber > 0)) then //will enter if specials are turned on AND (if its time to check for special OR we have remaining specials to do)
begin
StatusWithPaint('Checking special attack.');
DTM100 := DTMFromString('mWAAAAHicY2FgYHBgYmCwB+IjULyQkYFhHR AvAOI1QFyzIo9BSl+EwT/XkiGi2oGBC6gHGTOiYRAAAPnmCNY='); //DTMS for 100%,75% ... special bars
DTM75 := DTMFromString('mQwAAAHicY2ZgYLBnguAFIMzIwLAWiJcBsX OyIYOmpwJDep83AxdQHQwzImEgAAD6tQXo');
DTM60 := DTMFromString('mQwAAAHicY2ZgYHBgYmCwB+IuIF7EyMCwhh FCt2wuZTDyUmWYcKSegQuoDoYZkTAQAAAooAdH');
DTM55 := DTMFromString('mQwAAAHicY2ZgYGhmgeDjQCzNxMCgCcSyQO ycbMggpS/CMOFIPQMXUB0MMyJhIAAA5cgFbA==');
DTM50 := DTMFromString('mQwAAAHicY2ZgYHBgYmCwB+JaIF7EyMCwhh FCt2wuZTDyUmWYcKSegQuoDoYZkTAQAAAl1Qc6');
DTM25 := DTMFromString('mQwAAAHicY2ZgYHBgYmCwB+IoIF7EyMCwhh FCt2wuZTDyUmWYcKSegQuoDoYZkTAQAAAeUAcX');
SpecNumber := 0;
MarkTime(FailTime);
repeat
if (TimeFromMark(FailTime) > 5000) then Exit; //if failed to switch tabs, then it exits
GameTab(tab_Combat);
until (GetCurrentTab = tab_Combat)
SpecNumber := 0; //no matter if we have remaining specials to do, we will set it to 0 and determine it again
case SpecUsage of //determining how many specials we can do
100:
if FindDTM(DTM100,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
60:
if FindDTM(DTM60,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
55:
if FindDTM(DTM55,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
50:
begin
if FindDTM(DTM50,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
if FindDTM(DTM100,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 2;
end;
25:
begin
if FindDTM(DTM25,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
if FindDTM(DTM50,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 2;
if FindDTM(DTM75,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 3;
if FindDTM(DTM100,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 4;
end;
end;
MarkTime(SpecTime);
SpecWait := RandomRange(15000,60000); //next spec check in 15-60 seconds
if SpecNumber > 0 then //if we can spec
begin
StatusWithPaint('Using special attack.');
MouseBox(574,416,706,428,mouse_left);
Dec(SpecNumber);
end else //it cant do spec
begin
StatusWithPaint('Not enough special.');
Wait(RandomRange(500,4000));
StatusWithPaint('Back to fighting.');
MarkTime(FailTime);
repeat
if (TimeFromMark(FailTime) > 5000) then Exit;
GameTab(tab_Inv);
until (GetCurrentTab = tab_Inv)
end;
FreeDTM(DTM100);
FreeDTM(DTM75);
FreeDTM(DTM60);
FreeDTM(DTM55);
FreeDTM(DTM50);
FreeDTM(DTM25);
end;
end;



procedure LoginCheck;
begin
if not LoggedIn then
begin
StatusWithPaint('Logging in.');
if not LoginPlayer then
EndScript('We got logged out somehow and cant log in.');
end;
end;



procedure HpCheck;
var
colorstring, lobs, peaches : String;
FailTime, Amount : Integer;
done : Boolean;
begin
if (GetMMLevels('hp', colorstring) < EatAt) then
begin
MarkTime(FailTime);
repeat
if not b2p then //if not using B2P yet then we eat a simple food (lobster)
begin
StatusWithPaint('Eating lobster.');
Amount := 120; //healing amount for lobster
lobs := 'mggAAAHicY2NgYPjPxMDAzczAwMcMYX8E4p9ALMbIwMAKxNxA rMAI4fMC8f4EGaAuJgwsAiSxYUYcGAIAcgoGSA==';
if not EatFood(lobs) then
begin //if out of food
if not BonesToPeaches then //if not using B2P, then we log out
EndScript('Out of food.')
else
b2p := True; //lets start using B2P
end;
end;
if b2p then
begin
StatusWithPaint('Eating peaches.');
Amount := 80; //healing amount for peach
peaches := '78DA632C60626070626440069B3B52194480344C94310FA8C 60C550D030313AA9A32A01A0B026A6A806A1C08A8A906AA712 7A006E4663F026A52883007A4C69E809A4CC2FE0200D76708C 1'
if not EatFood(peaches) then //if out of peaches
begin
StatusWithPaint('Breaking B2P.');
if not BreakB2P then //if out of tablets
EndScript('Out of B2P tablets.');
if not EatFood(peaches) then //if broke tablet but cant eat peaches
EndScript('Failed to eat peaches after broking B2P.');
end;
end;
if (GetMMLevels('hp', colorstring) > (HpLevel * 10 - Amount)) or (TimeFromMark(FailTime) > 30000) then //if we no need to eat more (current hp > (maxhp - healamout)) (30 seconds timeout for fail safe)
done := True;
until done
end;
end;



procedure NoobCheck;
begin
if Length(GetMinimapDotsin('player',592,49,662,120)) > 0 then
begin
StatusWithPaint('Found a noob, waiting.');
MakeScreenShot('C:\Simba\Screenshots\ChaosMossKill er\noobs\');
Wait(RandomRange(5000,10000));
HopWorld;
end;
end;



function BonesCheck : Boolean;
var
LookedForBones : Integer;
begin
Result := False;
if BonesToPeaches then
begin //if using B2P then we need to collect bones
if not InvFull then
begin
LookedForBones := 0;
repeat
if FindBones(MSX1,MSY1,MSX2,MSY2) then
begin
StatusWithPaint('Picking up bones.');
Mouse(X,Y,0,0,mouse_right);
ChooseOptionCharms('ake Big');
Wait(1000);
repeat until not IsMoving
Result := True;
end;
Inc(LookedForBones);
until (InvFull) or (LookedForBones = 5) //looking for bones max 5 times (failsafe)
end;
end;
end;



procedure RandomsCheck;
begin
if FindNormalRandoms then
EndScript('Random event found!');
end;



procedure AmmoCheck; //function for Ranging
var
i : Integer;
done : Boolean;
begin
if LevelString = 'RNG' then
if FindChatBoxText('You have no ammo',8,ClBlack) then //ammo check
begin
StatusWithPaint('Out of ammo.');
Wait(1000);
if srl_inFight then
begin
StatusWithPaint('Still fighting, removing weapon.');
repeat until GameTab(tab_Inv)
if InvFull then
begin
i := 5;
done := False;
repeat
MMouseItem(i);
if IsUpTextMultiCustom(['Bury','ury','Eat','at']) then
begin
ClickMouse2(mouse_right);
if ChooseOptionMulti(['Drop','rop']) then
done := True;
end;
Inc(i);
until done
end;
repeat until GameTab(tab_Equip);
MouseBox(573,294,594,311,mouse_left);
StatusWithPaint('Removed weapon.');
EndScript('Out of ammo.');
end;

end;
end;



procedure SetupScript;
begin
ClearDebug;
Disguise('ChaosMossKiller Temp Fix By Mat');
Status('Starting script.');
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
Smart_Server := 24;
Smart_Members := Members;
Smart_Signed := Signed;
SMART_SuperDetail := False;
{$ELSE}
SmartPairClient(4440);
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
{$ENDIF}
SetupSRL;
ActivateClient;
DeclarePlayers;
SetupSRLStats(680, SRLStats_User, SRLStats_Password);
SPS_Setup(RUNESCAPE_OTHER,['chaos_tunnels']);
if PaintDebug then
SMART_ClearCanvas;
Status('Logging in.');
LoginPlayer;
end;



procedure Startup;
var
fails, FailTime : Integer;
done : Boolean;
begin
if srl_inFight then
begin
StatusWithPaint('Waiting till fight is over.');
repeat until not srl_InFight
end;

fails := 0;
done := True;
MarkTime(FailTime);
repeat
ToggleXPBar(True);
TrainedLevel := GetSkillLevel(TrainedSkill);
if (TrainedLevel = -1) then
begin
done := False;
fails := fails+1;
end;
HpLevel := GetSkillLevel('Hitpoints');
if (HpLevel = -1) then
begin
done := False;
fails := fails+1;
end;
StartXPtillNext := XPTillNextLevel(TrainedSkill);
if (StartXPtillNext = -1) then
begin
done := False;
fails := fails+1;
end;
StartXP := GetXPBar(XPCounter);
if (StartXP = -1) then
begin
done := False;
fails := fails+1;
end;
if (fails = 3) or (TimeFromMark(FailTime) > 30000) then
EndScript('Startup fail. Cant get level/read xps.');
until done

case TrainedSkill of
'Attack' : LevelString := 'ATK';
'Strength' : LevelString := 'STR';
'Defence' : LevelString := 'DEF';
'Range' : LevelString := 'RNG';
end;

case DebugLines of
true: doreport := False;
false: doreport := True;
end;

b2p := False;
LastXP := 0;
WorldHops := 0;
B2PUsed := 0;
FoodUsed := 0;
GoldCharms := 0;
GreenCharms := 0;
BlueCharms := 0;
CrimsonCharms := 0;

if UseSpecAttacks then
begin
SpecNumber := 0;
SpecWait := RandomRange(15000,45000);
MarkTime(SpecTime);
end;

ClearDebug;
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~');
WriteLn(' ChaosMossKiller Temp Fix By Mat ' + Version);
WriteLn(' - HP level : ' + IntToStr(HpLevel));
Writeln(' - ' + LevelString + ' level : ' + IntToStr(TrainedLevel));
Writeln(' - XP till next : ' + IntToStr(StartXPtillNext));
Writeln(' - XP Bar : ' + IntToStr(StartXP));
WriteLn(' - Starting script...');
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~');

MarkTime(StartTime);
SetAngle(SRL_ANGLE_HIGH);
end;



procedure Main;
var
DetectTime, KillTime : Integer;
done : Boolean;
begin
repeat

StatusWithPaint('Looking for Mosses.');
done := False;
MarkTime(DetectTime);
repeat
if (TimeFromMark(DetectTime) > 180000) then //180 seconds failsafe
EndScript('Cant find Mosses.');
if FindMoss(true) then //if clicked on moss
begin
if WaitInFight(4000) then //checking if we are fighting
done:=True
end else
begin //if failed to attack moss
StatusWithPaint(IntToStr(TimeFromMark(DetectTime)) +'ms');
case Random(20) of
0: CompassMovement(-120,120,false); //rotating camera for better view
end;
LoginCheck;
RandomsCheck;
if (TimeFromMark(DetectTime) > 10000) then //walking back to middle
WalkToCenter;
end;
until done //we are fighting now


StatusWithPaint('Fighting.');
MarkTime(KillTime);
repeat
Antiban;
AmmoCheck;
if (TimeFromMark(KillTime) < 5000) then //we dont want to waste special attack, so we only using it in the first 5 seconds
SpecialAttack;
if ((TimeFromMark(KillTime) > 5000) and (FindRedBar)) then //we are looking for redbar after 5 seconds of fighting
Break; //end of fight
Wait(500);
until ((TimeFromMark(KillTime) > 10000) and (not srl_inFight)) //failsafe is: 10 seconds and no hpbar above the player -> end of fight


StatusWithPaint('Killed Moss. Took '+MsToTime(TimeFromMark(KillTime),Time_Formal)+'.' );
Report;
stats_Commit; //committing stats (no variebles yet, only time)
BonesCheck; //this will look for bones if needed and pickst them up
FindAllCharms; //this will look for charms and picks them up
LoginCheck;
NoobCheck; //this will look for other players around
HpCheck; //this will check hp and eat (use b2p) if needed

until False
end;



begin

SetupScript;
Startup;
Main;

end.

This Complie so it should work unless RS Changed Anything.
Mat

Spenser171
08-15-2012, 06:28 AM
how do i go about using that one though, i tried to copy and paste it into simba but it pasted all of it horizontally

Shatterhand
08-15-2012, 10:29 AM
Script is updated! It should be stable, but there might be some bugs. Test and report! :)

kambyz
08-15-2012, 10:39 AM
uninstalled old Simba, installed new one. Still error :S


C:\Simba\Includes\srl\srl\misc\smart.simba(56:19): Invalid number of parameters at line 55
Compiling failed.

Leonardo Da Vinci
08-15-2012, 12:09 PM
All time, hands down favorite script ever.
I've gotten from like 60 attack, strength and defense all up to 80 in each (no doubt soon to be 99) because of this script.
Shatterhand, you're brilliant. Absolutely brilliant.

chief herb
08-16-2012, 09:41 PM
after taking a break from botting, i am finally back on the road to maxed melee stats! just got 98 hp with this and will be getting 99 def/ att possibly! thanks you so much! heres a proggie:)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ChaosMossKiller v6.1
* Time Running: 7 Hours, 57 Minutes and 3 Seconds
* XP Gained: 151258 (19024)
* Level: -1, XP till next: -1
* B2P: 0 Food: 16
* Charms: 316/22/8/13
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Shatterhand
08-16-2012, 09:50 PM
All time, hands down favorite script ever.
I've gotten from like 60 attack, strength and defense all up to 80 in each (no doubt soon to be 99) because of this script.
Shatterhand, you're brilliant. Absolutely brilliant.
Thanks. Good luck training! :)

after taking a break from botting, i am finally back on the road to maxed melee stats! just got 98 hp with this and will be getting 99 def/ att possibly! thanks you so much! heres a proggie:)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ChaosMossKiller v6.1
* Time Running: 7 Hours, 57 Minutes and 3 Seconds
* XP Gained: 151258 (19024)
* Level: -1, XP till next: -1
* B2P: 0 Food: 16
* Charms: 316/22/8/13
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks, and nice. Did you set up HP for xp counter? :)

bweibking
08-17-2012, 03:56 AM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ChaosMossKiller v6.1
* Time Running: 11 Hours, 31 Minutes and 58 Seconds
* DEF XP Gained: 654455 (56746)
* DEF Level: 92, XP till next: 80135
* B2P: 6 Food: 115
* Charms: 384/32/5/26
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Amazing Script!

wildnest1
08-20-2012, 01:56 PM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ChaosMossKiller v6.0
* Time Running: 8 Hours, 1 Minutes and 9 Seconds
* RNG XP Gained: 294241 (36691)
* RNG Level: 88, XP till next: 219915
* B2P: 8 Food: 176
* Charms: 157/9/2/8
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

bomzene
08-21-2012, 07:56 PM
Mine never seem to restart after 6 hours, it just say that Simba has experienced an error and will now close.

Shatterhand
08-21-2012, 08:26 PM
Mine never seem to restart after 6 hours, it just say that Simba has experienced an error and will now close.
Thats new to me. Take a picture of it?

chief herb
08-21-2012, 09:40 PM
its saying


** Smart Cannot Spawn Clients **
Successfully executed.

Shatterhand
08-21-2012, 10:12 PM
its saying


** Smart Cannot Spawn Clients **
Successfully executed.
Update everything and restart Simba.

Chen Monopoly
08-22-2012, 01:23 PM
The script would be awesome with excalibur support :).

Here's a bug report
I'm not sure what happened but the script just stopped, seems to be smart related, not script related.


Error: Exception: The Points you passed to DrawATPA exceed the bitmap's bounds at line 96
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, SRL - NavBar Bitmap, 4, 18]


{*
Authors: Sir R. Magician, Brandon.

Draws a TPA with a specified Colour onto Smart's Canvas.
Clears the Canvas first if Clear is set to true.
*} <- Line 96 is here
procedure SMART_DrawDotsEx(Clear: boolean; Pixels: TPointArray; Color: TColor);
{$IFDEF SMART}
var
P: TPointArray;
begin
if (not SMART_DebugSetup) then
SMART_SetupDebug;

if Clear then SMART_ClearCanvas;
P := CopyTPA(Pixels);
OffsetTPA(P, Point(SRL_NAVBAR_INGAME_X, SRL_NAVBAR_INGAME_Y));
SMART_Canvas.DrawTPA(P, Color);
{$ELSE}
begin
{$ENDIF}
end;

j 0n4s
08-22-2012, 09:49 PM
Amazing script works good. its rud to ask when the scripts works amazing but why can it only eat lobsters?:) Will come with progg report are on 2h and goin :P

Chen Monopoly
08-23-2012, 12:23 AM
To my post above, the problem seems to be that when world switching, it sometimes selects a F2P world.

Shatterhand
08-23-2012, 07:30 AM
To my post above, the problem seems to be that when world switching, it sometimes selects a F2P world.
Thats SRL include, I cant do anything about it...It was my bad, fixed.

Amazing script works good. its rud to ask when the scripts works amazing but why can it only eat lobsters?:) Will come with progg report are on 2h and goin :P
It doesnt matter what the food type is, because you can stay here for weeks with b2p tablets.

EDIT: Script is updated to v6.2! :)

bomzene
08-24-2012, 08:57 PM
Thanks for the update :)

BGXD
08-29-2012, 07:06 PM
A good script, but did not catch talisman: (

Liquid Atoms
08-30-2012, 11:56 AM
With version 6.0 in the past, it ran flawlessly overnight for 99 attack and 99 strenght,

When rs updated with the bar ontop, i stayed away for a bit, Yesterday i installed new simba with your script, the new version today, 6.2, and it got stuck clicking a law rune for 7 hours, they have very similar color patterns, is there any fix for this ?

feh55
08-30-2012, 11:57 AM
I got some problem with the script finding the charms, the PickUpCharms is set to true but it does not pick up any charms. I got one of each kind in my inventory but still nothing. Perhaps the ort is blocking the sight? What to do?

Shatterhand
08-30-2012, 02:18 PM
...it got stuck clicking a law rune for 7 hours, they have very similar color patterns, is there any fix for this ?
What law rune? :O

I got some problem with the script finding the charms, the PickUpCharms is set to true but it does not pick up any charms. I got one of each kind in my inventory but still nothing. Perhaps the ort is blocking the sight? What to do?
Yeah those things mess it up. Wiki says you can pick up 200 a day, try picking up 200 and maybe no more will be dropped?

feh55
08-30-2012, 03:23 PM
Yeah those things mess it up. Wiki says you can pick up 200 a day, try picking up 200 and maybe no more will be dropped?

I picked up 200 and it does not loot the charms. What camera zoom should i use?

Shatterhand
08-30-2012, 03:45 PM
I picked up 200 and it does not loot the charms. What camera zoom should i use?
Camera: middle. Do they still drop orts after 200?

feh55
08-30-2012, 04:21 PM
Camera: middle. Do they still drop orts after 200?
They dont drop orts after 200. Still not looting charms. Wierd. Everything updated, script v6.2, several restarts and log outs.
Thank you by the way for your replies.

I Switched to v6.1 and the charmlooting works there. Wierd.

Chen Monopoly
08-30-2012, 06:04 PM
Maybe there just hasn't been a visible charm yet since the charms may be hidden under other items, and color detection can't see that.

Shatterhand
08-30-2012, 06:17 PM
I Switched to v6.1 and the charmlooting works there. Wierd.
The colors are same in v6.1 and v6.2. It should work...

Mjordan
09-02-2012, 05:28 PM
I've maxed all of my combat except for range! This is one of my most favorite scripts I've ever used. So stable and reliable, thanks lots!

Shatterhand
09-02-2012, 07:35 PM
I've maxed all of my combat except for range! This is one of my most favorite scripts I've ever used. So stable and reliable, thanks lots!
Nice and thanks. :)

print
09-06-2012, 03:53 AM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ChaosMossKiller v6.2
* Time Running: 3 Hours, 52 Minutes and 18 Seconds
* ATK XP Gained: 227480 (58752)
* ATK Level: 90909090909, XP till next: 1b
* B2P: 2 Food: 48
* Charms: 27/1/0/2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Element17
09-06-2012, 04:14 AM
You can turn that off....I saw it on wiki the other day.

Solar
09-06-2012, 07:58 AM
You can turn that off....I saw it on wiki the other day.

:confused: Turn what off?

print
09-06-2012, 12:53 PM
lol this script ran for 8+ hours its incredible got me 470k exp

Leonardo Da Vinci
09-09-2012, 04:32 AM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ChaosMossKiller v6.1
* Time Running: 14 Hours, 38 Minutes and 42 Seconds
* DEF XP Gained: 0 (0)
* DEF Level: 83, XP till next: 58486
* B2P: 6 Food: 164
* Not picking up charms.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For some reason when I choose strength or defense it doesn't tell me my EXP gained, or how much I have left until I level. But I leveled my defense 3 times.
I love this script!

print
09-09-2012, 05:03 AM
how did you go 14 hours without logging out????

Leonardo Da Vinci
09-09-2012, 05:15 AM
how did you go 14 hours without logging out????

Nothing, just pressed play.
For some reason it doesn't stop after six hours... Which is awesome as hell.

HolyWord
09-09-2012, 07:04 AM
Nothing, just pressed play.
For some reason it doesn't stop after six hours... Which is awesome as hell.

Yea you can have longer proggies with the "SRL_SixHourFix" :)

print
09-09-2012, 03:24 PM
i think im start useing that srcript more haha

Leonardo Da Vinci
09-09-2012, 03:37 PM
Yea you can have longer proggies with the "SRL_SixHourFix" :)
I really should have known that. God damn it.
Thank you.


i think im start useing that srcript more haha
It's a brilliant script, man... I just wish there was also another script that got more EXP quicker. I want to get all my combat skills to 99 before EOC.

Deni_mulic
09-12-2012, 07:02 AM
Longest proggy?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ChaosMossKiller v6.2
* Time Running: 32 Hours, 27 Minutes and 18 Seconds
* STR XP Gained: 1444409 (44505)
* STR Level: 82, XP till next: 193890
* B2P: 32 Food: 840
* Not picking up charms.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xD

Shatterhand
09-12-2012, 07:10 AM
Longest proggy?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ChaosMossKiller v6.2
* Time Running: 32 Hours, 27 Minutes and 18 Seconds
* STR XP Gained: 1444409 (44505)
* STR Level: 82, XP till next: 193890
* B2P: 32 Food: 840
* Not picking up charms.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xD
Dammn, it is! Nice. :D

Deni_mulic
09-12-2012, 12:50 PM
Final proggy, only stopped cause I wanted to go pking :D
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ChaosMossKiller v6.2
* Time Running: 38 Hours, 15 Minutes and 30 Seconds
* STR XP Gained: 1723634 (45053)
* STR Level: 83, XP till next: 192924
* B2P: 37 Food: 1003
* Not picking up charms.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

aus tom
09-12-2012, 01:02 PM
omg?

BaYBeeZ
09-15-2012, 01:15 AM
Hey, the script keeps saying this over and over again:

Warning! You passed a wrong ye to a finder function: 2112. The client has a height of 503, thus the ye is out of bounds. Setting the value to 502 (h-1) for now.

Not sure what it means, but my character still fights the moss giants just fine. The mouse seems to constantly hover over the XP circle by the mini map though so I'm not sure if I've set up my XP counter correctly.

I was a little bit confused as to what it means by setting up the XP counter for trained level, I'm assuming that just means set it to attack if that's what I want to train? Sorry for the stupid question, I haven't been on Runescape for a couple months and never used the XP counter before.

Deni_mulic
09-15-2012, 10:10 AM
new longest proggy, finished my rune pure for f2p :)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ChaosMossKiller v6.2
* Time Running: 44 Hours, 53 Minutes and 44 Seconds
* STR XP Gained: 2143756 (47750)
* STR Level: 90, XP till next: 543294
* B2P: 41 Food: 1071
* Not picking up charms.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Shatterhand
09-15-2012, 01:24 PM
new longest proggy, finished my rune pure for f2p :)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ChaosMossKiller v6.2
* Time Running: 44 Hours, 53 Minutes and 44 Seconds
* STR XP Gained: 2143756 (47750)
* STR Level: 90, XP till next: 543294
* B2P: 41 Food: 1071
* Not picking up charms.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Very nice, gratz. Thanks for the awesome proggies! :)

Ivo09
09-17-2012, 08:53 AM
Does srl_sixhourfix apply to smart 7.2 now? Or is that picture in the OP just a really lucky run?

Shatterhand
09-17-2012, 09:02 AM
Does srl_sixhourfix apply to smart 7.2 now? Or is that picture in the OP just a really lucky run?
Yes it does.

Ivo09
09-17-2012, 10:27 AM
17 minutes and not a single charm. I've noticed a few myself but they were always under 2-3 items. I don't suppose you have any tips on improving my chances?

ChaosMossKiller v6.1
* Time Running: 43 Minutes and 9 Seconds
* ATK XP Gained: 38413 (53398)
* ATK Level: 84, XP till next: 2988XX
* B2P: 0 Food: 0
* Charms: 0/0/0/0

Apart from that, so far so good.

Shatterhand
09-17-2012, 10:50 AM
17 minutes and not a single charm. I've noticed a few myself but they were always under 2-3 items. I don't suppose you have any tips on improving my chances?

Were those charms visible or you paused the scripr and right clicked to find them?

Ivo09
09-17-2012, 10:54 AM
Right clicked. Like I said they were under multiple items. I think I could probably use a bonecrusher to make the charms show up easier. I just posted a proggy, you can see how much food I eat lol.

WT-Fakawi
09-17-2012, 11:00 AM
@Shatterhand: check out my Moss giant killer. You will like the way I implemented ChooseOptionMulti:

My script searches for bones on MainScreen, richtclicks it, but than first picks up charms/seeds/rares etc, and leaves the bone until last. Script scrolls through the KeepList which has bones last in the list. So the terribly good visible bones remain on the ground until everything else from that spot is picked up:)



KeepList := ['Spirit weed seed', 'Spin ticket', 'Uncut diamond',' Uncut ruby' , 'Uncut emerald', 'Uncut sapphire',
'oins','sword','spear','shield', // any occurence of this list is picked up.
'helm','javelin', 'staff', 'dart','bolts','teel arrow', 'ragonstone',
'Ranarr seed', 'Toadflax seed', 'Snapdragon seed', 'Dwarf weed seed', 'Torstol seed', 'Spirit weed seed',
'Blood rune', 'Death rune', 'Chaos rune', 'Air rune', 'Earth rune', 'Law rune', 'Nature rune','charm', 'Spinach roll', 'Long bone', 'key', 'guam', 'Big bones', 'Bones']; // BONES IS LAST IN LIST so we pickup anything before bones :))))


function WTChooseOptionMultiEx(Texts: TStringArray; TextType: String; var ResultText: String; Action: fnct_ActionOptions): Boolean;
var
B: TBox;
i, H, ii, L, x: Integer;
T: TPoint;
Options: array of TOptions;
begin
Result := False;
Options := GetChooseOptions(TextType);
if (Length(Options) < 1) then
Exit;
H := High(Options);
L := High(Texts);
for i := 0 To L do
begin
for ii := 0 to H do
If Pos(Texts[i], Options[ii].Str) > 0 Then
begin
Result := True;
ResultText := Options[ii].Str;
B := Options[ii].Bounds;
GetMousePos(T.x, T.y);
case Action of
ClickLeft: if PointInBox(T, B) then
Mouse(T.x, T.y, 0, 0, True)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Move: if not PointInBox(T, B) then
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 3);
Nothing: begin end;
else
srl_warn('ChooseOptionMultiEx', 'ClickRight not a valid click for RS menus!', warn_AllVersions);
end;
Exit;
end;
end;
B := Options[0].BigBox;//to mmouse away
if Action <> Nothing then
begin
x := Max(B.X1 - 52, 0);
if x = 0 then
x := B.X2+10;
MMouse(x, Max(B.Y1 - 50, 0), 40, B.Y2-B.Y1);
Wait(200 + Random(100));
end;
end;

Ivo09
09-17-2012, 11:01 AM
@Shatterhand: check out my Moss giant killer. You will like the way I implemented ChooseOptionMulti:

My script searches for bones on MainScreen, richtclicks it, but than first picks out charms/seeds/rares etc, and leaves the bone until last. It scroll through the KeepList which has bones last in the list. so the bones remain on the ground until everything else from that spot is picked up:)



KeepList := ['Spirit weed seed', 'Spin ticket', 'Uncut diamond',' Uncut ruby' , 'Uncut emerald', 'Uncut sapphire',
'oins','sword','spear','shield', // any occurence of this list is picked up.
'helm','javelin', 'staff', 'dart','bolts','teel arrow', 'ragonstone',
'Ranarr seed', 'Toadflax seed', 'Snapdragon seed', 'Dwarf weed seed', 'Torstol seed', 'Spirit weed seed',
'Blood rune', 'Death rune', 'Chaos rune', 'Air rune', 'Earth rune', 'Law rune', 'Nature rune','charm', 'Spinach roll', 'Long bone', 'key', 'guam', 'Big bones', 'Bones']; // BONES IS LAST IN LIST so we pickup anything before bones :))))


function WTChooseOptionMultiEx(Texts: TStringArray; TextType: String; var ResultText: String; Action: fnct_ActionOptions): Boolean;
var
B: TBox;
i, H, ii, L, x: Integer;
T: TPoint;
Options: array of TOptions;
begin
Result := False;
Options := GetChooseOptions(TextType);
if (Length(Options) < 1) then
Exit;
H := High(Options);
L := High(Texts);
for i := 0 To L do
begin
for ii := 0 to H do
If Pos(Texts[i], Options[ii].Str) > 0 Then
begin
Result := True;
ResultText := Options[ii].Str;
B := Options[ii].Bounds;
GetMousePos(T.x, T.y);
case Action of
ClickLeft: if PointInBox(T, B) then
Mouse(T.x, T.y, 0, 0, True)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Move: if not PointInBox(T, B) then
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 3);
Nothing: begin end;
else
srl_warn('ChooseOptionMultiEx', 'ClickRight not a valid click for RS menus!', warn_AllVersions);
end;
Exit;
end;
end;
B := Options[0].BigBox;//to mmouse away
if Action <> Nothing then
begin
x := Max(B.X1 - 52, 0);
if x = 0 then
x := B.X2+10;
MMouse(x, Max(B.Y1 - 50, 0), 40, B.Y2-B.Y1);
Wait(200 + Random(100));
end;
end;


Wouldn't that slow the script down a fair bit? Or does it check during combat?

WT-Fakawi
09-17-2012, 11:28 AM
Wouldn't that slow the script down a fair bit? Or does it check during combat? Nah, that used to be an issue 8 years ago. Everything is smooth and fast now :) Besides I only pickup items when done fighting.

Ivo09
09-17-2012, 12:02 PM
Nah, that used to be an issue 8 years ago. Everything is smooth and fast now :) Besides I only pickup items when done fighting.

Ah okay nice.

I seem to recall a similar problem with caffeinated killer a few months ago so I was curious.

ChaosMossKiller v6.1
* Time Running: 1 Hours, 52 Minutes and 32 Seconds
* ATK XP Gained: 99488 (53038)
* ATK Level: 84, XP till next: 2378XX
* B2P: 0 Food: 4
* Charms: 3/1/0/0

A proggy for you OP, next one will be overnight. Pretty flawless script.

Shatterhand
09-17-2012, 12:47 PM
I think I could probably use a bonecrusher to make the charms show up easier. I just posted a proggy, you can see how much food I eat lol.
This would be best for you if you need those charms. By the way v6.2 is the latest version, use that.

@WT-Fakawi: I already have a similar function (named ChooseOptionCharms) which picks up charms before bones.
The problem is: my script doesnt burry bones, it picks them up for B2P. Memorizing the checked bone piles would be very hard with colors, so I see no ways improving charm looting without wasting time/XP.

WT-Fakawi
09-17-2012, 02:07 PM
This would be best for you if you need those charms. By the way v6.2 is the latest version, use that.

@WT-Fakawi: I already have a similar function (named ChooseOptionCharms) which picks up charms before bones.
The problem is: my script doesnt burry bones, it picks them up for B2P. Memorizing the checked bone piles would be very hard with colors, so I see no ways improving charm looting without wasting time/XP.

Yes, I saw that function in your script. All I do in my script is leave the bones on the ground. I safe them for last so-to-speak. I first pick up stuff that is lying underneath the bones. I dont memorize anything, I just see them big white blobs lying on the floor :) I get 100% of the time all the charms, all the torstol, all the snapdragon, ranarr's, etc.... all cool stackable stuff.

EDIT: Ok I see. That is a problem :) Why dont you pick them up and bury them, (15 xp) and use B2P when needed?

Ivo09
09-17-2012, 08:17 PM
ChaosMossKiller v6.1
* Time Running: 8 Hours, 3 Minutes and 28 Seconds
* ATK XP Gained: 394484 (48956)
* ATK Level: 85, XP till next: 182436
* B2P: 1 Food: 29
* Charms: 120/14/1/3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Exception in Script: Failed to create new thread, code:8
The following DTMs were not freed: [0, SRL - Lamp bitmap]
The following bitmaps were not freed: [SRL - NavBar Bitmap, SRL - Flag bitmap, SRL - Admin bitmap, 4, SRL - Mod bitmap]

Crashed after I woke up. Will try 6.2 tonight. Running on a 1.1ghz dual core celeron so I didn't expect this much. Great script!



EDIT: Ok I see. That is a problem :) Why dont you pick them up and bury them, (15 xp) and use B2P when needed?


That would slow down even a legit player at least a little. It's not worth it considering this is a combat exp script. There's always the ghouler for those who desperately need charms and this script gets tons anyway as you can see from my proggy.

suhstain
09-18-2012, 12:43 AM
this bot is so awesome, so close to 99str thanks so much :)

Ivo09
09-21-2012, 08:12 AM
[Error] C:\Simba\Includes\SRL/SRL/misc/SmartParams.Simba(278:134): Type mismatch at line 277
Compiling failed.

Any ideas? Is there a new update?

Fixed. Replace line 287 of smartparams with


Result:= SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's', '', '',-1);

Mewtwo
09-26-2012, 04:49 AM
Boss went for 15 hours . never seen a script run so long :D

print
09-26-2012, 04:54 AM
^^lol this chicken shows his rsn in the attched thumbnail

strongkook
09-26-2012, 08:58 PM
can someone please offer some assistance for just about every script i try i get something like

[Error] C:\Simba\Includes\SRL/SRL/misc/smart.simba(46:19): Invalid number of parameters at line 45
Compiling failed.

strongkook
09-26-2012, 08:59 PM
oops bump

Ashaman88
09-26-2012, 09:19 PM
oops bump

http://villavu.com/forum/showthread.php?t=88578

Mr[S]
09-28-2012, 03:29 PM
Ok so now that in less than a day i've got my new secondary account from level 3 to level 50 Ill try this script again, lets see how fast I can get all forms of melee up to level 60 :p

Mr[S]
09-28-2012, 04:16 PM
Totally forgot its a multicombat thingy so my plan didnt work :(

Mr[S]
09-29-2012, 09:34 AM
ChaosMossKiller v6.2
* Time Running: 17 Hours, 5 Minutes and 31 Seconds
* ATK XP Gained: 713117 (41722)
* ATK Level: 82, XP till next: 202589
* B2P: 11 Food: 253
* Charms: 110/6/1/5

More to come

Mooonb
09-29-2012, 10:13 AM
Thanks you so much!
Got 99str 99att 99def and 99hp from this script!

Solar
09-29-2012, 10:14 AM
ChaosMossKiller v6.2
* Time Running: 17 Hours, 5 Minutes and 31 Seconds
* ATK XP Gained: 713117 (41722)
* ATK Level: 82, XP till next: 202589
* B2P: 11 Food: 253
* Charms: 110/6/1/5

More to come

Sharm, instead of triple posting or double posting, edit you previous post.
Nice proggy all the same.

Shatterhand
10-04-2012, 07:35 AM
New version supports looting.
It doesnt loot everything 100%, but has a high chance. Looted like 300k and a lot of charms in 8 hours. XP/h is lowered a bit, but it makes it more human.
What do you think? Should I release this to public, or just members+?
|-->| (http://i.imgur.com/EeHGi.png)

stuartroad
10-04-2012, 07:52 AM
well 300k for 8 hours work, not gonna really start any gold farming buisness with that are you. If you are worried, release one without all those special lootings, just better charm looting.

iamafish33
10-04-2012, 06:50 PM
300k for 8 hours isn't going to crash anything IMO and I love your script but like others I wish it was a little better at the charm looting and making a lil cash on the side would be amazing! Would greatly appreciate it!

Smurf From RiD
10-04-2012, 10:03 PM
Loving this nifty little bot! very well done, will post some proggies soon :D.

Crazydictator
10-09-2012, 04:04 PM
The Chaos Tunnels have been updated now, not sure if that will affect anything.. The bot still seems to be working for now. :spot: :f:

Shatterhand
10-09-2012, 04:18 PM
The Chaos Tunnels have been updated now, not sure if that will affect anything.. The bot still seems to be working for now. :spot: :f:
Yea nothing really changed.
New version (v7.0) is relased! Read the first post/script setup carefully. :)

Crazydictator
10-09-2012, 05:34 PM
Perfect, you might want to turn Debug box and lines off though. :)

Crazydictator
10-12-2012, 08:44 PM
Not sure if it's the script or SRL.. I keep getting this every hour or so.

It has been 3 minutes and Runescape is not yet ready... Terminating.
Successfully executed.
The following DTMs were not freed: [2]

Shatterhand
10-12-2012, 09:34 PM
Not sure if it's the script or SRL.. I keep getting this every hour or so.

It has been 3 minutes and Runescape is not yet ready... Terminating.
Successfully executed.
The following DTMs were not freed: [2]
http://villavu.com/forum/showthread.php?t=90967

skull lord
10-13-2012, 02:14 AM
Great Bot! I "Babysat" it for awhile, but the script did everything right. 10/10 for moss giant killing!

Jeroen
10-13-2012, 10:49 AM
Nice bot! Used it before, version 5 i believe. This is awesome and i trust your script 100% overnight. :) Only thing is.. in the past versions it was only looting charms, and now it is looting charms but also looting some other runes etc. I dont want the runes, does the script drops it? Otherwise im wasting B2P. :(

Shatterhand
10-13-2012, 11:45 AM
Nice bot! Used it before, version 5 i believe. This is awesome and i trust your script 100% overnight. :) Only thing is.. in the past versions it was only looting charms, and now it is looting charms but also looting some other runes etc. I dont want the runes, does the script drops it? Otherwise im wasting B2P. :(
No, it loots charms and valuables both. I didnt want to make too many options. Its not a waste tbh, you can get great money in long term. Ring of wealth helps a lot.

Bixby Sayz
10-14-2012, 08:56 PM
Nice script. My only complaint with this is the same one I have with virtually every combat script on this site: No scripters seem to "get" that users REALLY want the ability to collect and bury bones.

Deni_mulic
10-15-2012, 01:35 PM
Nice script. My only complaint with this is the same one I have with virtually every combat script on this site: No scripters seem to "get" that users REALLY want the ability to collect and bury bones.

1. This feature defeats the purpose of this script.
2. Bonecrusher fulfils this purpose, look into acquiring one.

Mjordan
10-15-2012, 02:05 PM
Nice script. My only complaint with this is the same one I have with virtually every combat script on this site: No scripters seem to "get" that users REALLY want the ability to collect and bury bones.The decrease in combat xp/hour is not anywhere near worth the minimal prayer xp. I used a bonecrusher here and it was such small prayer xp/hour that it wouldn't be worth the time to pick them up and bury.

Deni_mulic
10-17-2012, 01:40 AM
Nvm, didn't read the above posts. Waiting for a fix :)

Bixby Sayz
10-17-2012, 01:37 PM
The decrease in combat xp/hour is not anywhere near worth the minimal prayer xp. I used a bonecrusher here and it was such small prayer xp/hour that it wouldn't be worth the time to pick them up and bury.That is your opinion. The combat xp/hour is not always the primary focus for the end user. Saving money on prayer wherever possible often is.

deliriouspuppet
10-20-2012, 12:27 AM
good script, it ran for about 5 hours for 50k xp/hr, however when it didnt pick up any good drops. just the osscasional charm and 1 ranarr seed.

ty for script, ill continue to use it

Deni_mulic
10-23-2012, 01:23 AM
Going for another 40+ hour proggy, this time maxing ranged. Let you know how it goes :)
Edit: Error creating thread at 9 hours 40 minutes

Shatterhand
10-23-2012, 07:53 AM
Going for another 40+ hour proggy, this time maxing ranged. Let you know how it goes :)
Edit: Error creating thread at 9 hours 40 minutes
Awww. :D

Jeroen
10-23-2012, 01:20 PM
Did i told you this script is really awesome? :)
Got me 4M + Defence xp this week.
What's new in version 7.1?

Shatterhand
10-23-2012, 02:53 PM
Did i told you this script is really awesome? :)
Got me 4M + Defence xp this week.
What's new in version 7.1?
Thanks, and nice. :)
Its on the first post; mostly some improvements on looting. Although it still not perfect, working on it.

whitegamerboi
10-24-2012, 02:42 PM
Hey ive been using this script for a while now, its very stable for me and runs for a long time! Excellent script.

masman7
10-25-2012, 01:00 AM
this randomly stopped working for me today after the halloween update applied. it is now telling me my combat level is too low.. im lvl 115, then it just sits and does nothing

Shatterhand
10-25-2012, 03:59 AM
this randomly stopped working for me today after the halloween update applied. it is now telling me my combat level is too low.. im lvl 115, then it just sits and does nothing

Update SRL and restart.

masman7
10-26-2012, 12:52 AM
thanks works perfect now, getting about 55k exp/h and like 100k in ranaar seeds per run sesh

Parfilo
10-26-2012, 01:19 PM
Very great script, but I think that all valuable seeds, rare drops, and charms should be improved in picking up. As I was babysitting the script watching it miss many valuable drops, I caught a seed that it didn't click, and it was a torstol seed which I manually had to get. So one thing to improve is the look pickup, but everything else is perfect, and this script (fighting wise) is flawless!

Shatterhand
10-26-2012, 04:32 PM
Very great script, but I think that all valuable seeds, rare drops, and charms should be improved in picking up. As I was babysitting the script watching it miss many valuable drops, I caught a seed that it didn't click, and it was a torstol seed which I manually had to get. So one thing to improve is the look pickup, but everything else is perfect, and this script (fighting wise) is flawless!
You give me a better idea on how to then I'll do it...

Parfilo
10-26-2012, 05:49 PM
I don't even know how :P
All I can do is give constructive criticism, nothing with scripting haha :D
It's a good script though, I get good xp.
Also, do you have the rare drop table for this in the script?

Shatterhand
10-26-2012, 06:11 PM
I don't even know how :P
All I can do is give constructive criticism, nothing with scripting haha :D
If you read back a little, people already posted about it...

Also, do you have the rare drop table for this in the script?
Yes, I added most of them. Dont forget to use ring of wealth to improve the chances.

Deni_mulic
10-28-2012, 01:57 AM
Had a few problems after the start of Bonus XP weekend - turns out it was just lag.

70k/hr Ranged exp :D

Will let you know if I can break 10 hours without "error creating thread" haha

edit:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ChaosMossKiller v7.1
* Time Running: 8 Hours, 9 Minutes and 24 Seconds
* RNG XP Gained: 571170 (70024)
* RNG Level: 89, XP till next: 324151
* B2P: 11 Food: 180
* Charms: 192/16/17/1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Shatterhand
10-31-2012, 07:40 PM
Had a few problems after the start of Bonus XP weekend - turns out it was just lag.

70k/hr Ranged exp :D
Nice!
This weekend was a joke. Double xp but half speed.
Only got some hours of 80k/h...
EDIT: Btw here is my inventory after using 70 B2Ps. :D
http://i.imgur.com/6dTVS.png

stuartroad
11-01-2012, 04:33 AM
Hey buddy, I have searched for an answer to my problem, but i can't find it, it also only seems to happen with your script. i get the error,
"it's been 3 minutes and rs isn't loaded yet"
this generally happens about the 3 hour mark.

chief herb
11-03-2012, 10:05 PM
shatterhand i have used this script for awhile now and would like too sincerely thank you for keeping this script up and running ive used previous versions and the 7.1 is working better than i would be! haha also on my road to 99 def and hp with this script. thanks alot

Jibbz
11-04-2012, 08:45 PM
ChaosMossKiller v7.1
* Time Running: 7 Hours, 1 Minutes and 19 Seconds
* STR XP Gained: 412241 (58705)
* STR Level: 96, XP till next: 626635
* B2P: 23 Food: 444
* Charms: 198/12/14/7
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Epic Script.

chief herb
11-05-2012, 12:13 AM
one thing tho, is when looting is on and it needs another inv slot it will just drop my lobster when it could have ate it for some health. not too big of a bug but just a waste of lobbys

Shatterhand
11-05-2012, 07:24 AM
one thing tho, is when looting is on and it needs another inv slot it will just drop my lobster when it could have ate it for some health. not too big of a bug but just a waste of lobbys
Ye I know that. There are some problems, sometimes it misreads the uptexts, thats why I made it to use less text reading.

chief herb
11-05-2012, 08:48 AM
Ye I know that. There are some problems, sometimes it misreads the uptexts, thats why I made it to use less text reading.
oh true, not that big of a deal! im about to hit 98 def, just something i noticed.

chief herb
11-05-2012, 08:08 PM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ChaosMossKiller v7.1
* Time Running: 8 Hours, 6 Minutes and 31 Seconds
* XP Gained: 434406 (53572)
* Level: 98, XP till next: 780833
* B2P: 2 Food: 59
* Charms: 337/28/28/2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

mr. pali
11-08-2012, 12:16 AM
Hey so I've been running this script for about 2 hours now.
It works well, but the bones-picking isn't working. In both 7.0 on 7.1 with itempicking on or off, (for runes etc.), the script will pick up 1 - 2 bones fine, then start clicking where it picked the previous bones up (x,y coords on screen, not the ingame location) and will do so 5 - 10 times. Then it will go back to killing mossies.

Other than that, its working well. But because its not picking up enough bones, i seem to be falling back a few peaches every b2p cycle.

Thanks

-pali

edit:

So I scrolled back a few pages and found an edited 6.2 script. I've been using it, and it works okay. Only issue is that it put the cursor over the portal thinking it is bones, but it doesn't click or anything. Probably a color issue. Still picks up enough bones, better than 7.0 or 7.1 in this respect.

Anyways

Great script!

Shatterhand
11-08-2012, 03:47 AM
Hey so I've been running this script for about 2 hours now.
It works well, but the bones-picking isn't working. In both 7.0 on 7.1 with itempicking on or off, (for runes etc.), the script will pick up 1 - 2 bones fine, then start clicking where it picked the previous bones up (x,y coords on screen, not the ingame location) and will do so 5 - 10 times. Then it will go back to killing mossies.

Other than that, its working well. But because its not picking up enough bones, i seem to be falling back a few peaches every b2p cycle.

Thanks

-pali

edit:

So I scrolled back a few pages and found an edited 6.2 script. I've been using it, and it works okay. Only issue is that it put the cursor over the portal thinking it is bones, but it doesn't click or anything. Probably a color issue. Still picks up enough bones, better than 7.0 or 7.1 in this respect.

Anyways

Great script!
Thanks for your feedback. That x,y coord clicking is already fixed in my version. The way the bones looting works since 6.2 is that it loots max 1 bones per kill (calls the looting function 1x, and it exits after picking up something). If you "waste" bones then it seems you are low def and get hit a lot.
I will release my fixed version (been running it for weeks, works fine) and ill make an option to set up how frequent should it loot things. It will solve your problem.

@Jibbz and chief:
Thanks for the proggies.

chief herb
11-08-2012, 06:30 AM
hit 99 def with this script, going for hp 120kish off. next is attack

mr. pali
11-08-2012, 09:30 PM
Thanks for your feedback. That x,y coord clicking is already fixed in my version. The way the bones looting works since 6.2 is that it loots max 1 bones per kill (calls the looting function 1x, and it exits after picking up something). If you "waste" bones then it seems you are low def and get hit a lot.
I will release my fixed version (been running it for weeks, works fine) and ill make an option to set up how frequent should it loot things. It will solve your problem.

@Jibbz and chief:
Thanks for the proggies.

This script is excellent!!

Do you mind if I borrow some ideas from it for future scripts? I'd give you credit.

When will you be releasing this fixed version?

Thanks

-Pali

Shatterhand
11-08-2012, 09:39 PM
This script is excellent!!

Do you mind if I borrow some ideas from it for future scripts? I'd give you credit.

When will you be releasing this fixed version?

Thanks

-Pali
Thanks, I dont mind, maybe tomorrow.
Have fun botting till you can. :D

___
11-08-2012, 09:43 PM
You should consider making a hill giant killer and bone burier script.

Mr[S]
11-11-2012, 08:23 PM
7.2 is really good has picked up 400 gold charms in 7 hours 23 green charms 28 crimson and 10 blues :D

masman7
11-12-2012, 06:22 PM
since 7.2 this script works very very good gets about 50k exp/h and makes a decent amount of money while collecting lots of charms, is there any way to add snapdragon seeds to the loot list? ive seen it miss a few of them and they are worth 30k each

Shatterhand
11-12-2012, 06:57 PM
since 7.2 this script works very very good gets about 50k exp/h and makes a decent amount of money while collecting lots of charms, is there any way to add snapdragon seeds to the loot list? ive seen it miss a few of them and they are worth 30k each
Its on the list, the script wont check every single loot piles, does it randomly. So there is a chance to miss some.

masman7
11-12-2012, 07:04 PM
i see but mine has never looted one ive seen it check a pile with one but not take it

edit: can u make an option to loot coins too i feel it would accumulate a decent amount over long runs

dabomb01
11-14-2012, 04:42 AM
Exception in Script: Failed to create new thread, code:8
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, SRL - NavBar Bitmap, 4]

happens wayyyy to frequently, help :-/

Olly
11-14-2012, 04:59 AM
Exception in Script: Failed to create new thread, code:8
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, SRL - NavBar Bitmap, 4]

happens wayyyy to frequently, help :-/

Memory leak issue... shatter should check to see if he's using any many wrapper functions as he can :p

dabomb01
11-14-2012, 10:40 AM
anything that can be done about this realitively easily? I realize the new combat system is due to drop this week and no one wants to put effort into something thats effectively already outdated im just tryin to catch a couple extra levels before the system is released and this memory leak issue is really hindering my progress -- otherwise great script lots of time spent on it keep it up for the new system ..... idk how thats gonna be botable =P

chief herb
11-15-2012, 06:56 AM
im using 7.1 got 2 99's with it. hp and defence. attack is next. hopefully can get 99 before eoc. im at 95 with 400kish. think i got it?

Nomads
11-19-2012, 04:19 AM
Hey there,

First time posting. I Noticed earlier that someone posted
'It has been 3 minutes and Runescape is not yet ready... Terminating.'

I am wondering if the problem has been worked out? I'm getting anywhere from 1-3 hours before this happens.

Shatterhand
11-19-2012, 05:15 AM
Hey there,

First time posting. I Noticed earlier that someone posted
'It has been 3 minutes and Runescape is not yet ready... Terminating.'

I am wondering if the problem has been worked out? I'm getting anywhere from 1-3 hours before this happens.
Its not solved yet, I get it too. :(

Nomads
11-20-2012, 03:20 AM
I did catch it before saying 'We have been logged out' when still logged in, I sat and observed it for a bit, it then let itself time out in the lobby.

I am unsure of what could be causing it to think it has been logged out?

Shatterhand
11-20-2012, 07:40 AM
I did catch it before saying 'We have been logged out' when still logged in, I sat and observed it for a bit, it then let itself time out in the lobby.

I am unsure of what could be causing it to think it has been logged out?
The srl function LoggedIn which should determine wether we are logged in or not does not work properly. The script calls the function many many times, so theres is a low chance the script will stuck cause of that.

nkd2009
11-20-2012, 05:45 PM
First thanks for making this script. It works nearly flawlessly and has helped me immensely. i was wondering though if you could incorperate the abilities bar into it somehow. After EOC this script still works fine but it seems the xp rate was nearly halved since it doenst utilize that abilities bar. Also it doesnt always finish killing the mossgiant which matter now since you only get xp upon a monster death. thanks again man

Paradox122
11-20-2012, 06:45 PM
First thanks for making this script. It works nearly flawlessly and has helped me immensely. i was wondering though if you could incorperate the abilities bar into it somehow. After EOC this script still works fine but it seems the xp rate was nearly halved since it doenst utilize that abilities bar. Also it doesnt always finish killing the mossgiant which matter now since you only get xp upon a monster death. thanks again man

Yes this bot still works fine for me, but i look forward to seeing what you will do with the abilities bar. Thanks for a great script man.

Shatterhand
11-20-2012, 08:34 PM
Yes this bot still works fine for me...
Really? I doubt it works fine, cause you get xp after a kill, not after a hit.

nkd2009
11-21-2012, 01:36 AM
Really? I doubt it works fine, cause you get xp after a kill, not after a hit.

well even if it doesnt kill the guy the first attempt, it usually auto retaliates or reclicks on the monster and you end up killing him in one hit. But yes it doesnt work as well. My xp/hour went from 50k down to around 22k after the update. Do you think you will rework the script to work with the EOC?

SeanStar
11-21-2012, 04:10 AM
I've reworked this script to use momentum when it detects a full yellow bar of adrenaline (Basically a copy of the RedBar function). This allows for better xp rates.. as for the InFight boolean, just set it to like 10 seconds and it works ok-ish. I'll work out a solid fix for it by tomorow though.

Shatterhand
11-22-2012, 05:26 PM
well even if it doesnt kill the guy the first attempt, it usually auto retaliates or reclicks on the monster and you end up killing him in one hit. But yes it doesnt work as well. My xp/hour went from 50k down to around 22k after the update. Do you think you will rework the script to work with the EOC?
Well, I dont think I will rework this. But I'm working on another combat script, probably an AIO one. As I dont plan getting members again, Ill stick to f2p monsters.
EDIT: Theres no high leve monsers in f2p. Like impossible to train combat in f2p...

nkd2009
11-25-2012, 06:24 PM
Well, I dont think I will rework this. But I'm working on another combat script, probably an AIO one. As I dont plan getting members again, Ill stick to f2p monsters.
EDIT: Theres no high leve monsers in f2p. Like impossible to train combat in f2p...

well good luck with the new script. I look forward to testing it. and ya their really arnt many good F2P monsters to train on.

Mr[S]
11-26-2012, 08:02 PM
Well, I dont think I will rework this. But I'm working on another combat script, probably an AIO one. As I dont plan getting members again, Ill stick to f2p monsters.
EDIT: Theres no high leve monsers in f2p. Like impossible to train combat in f2p...

You should create the script while you still have mems and if anything messes up we will pay for your mems :p

Shatterhand
11-28-2012, 08:11 AM
;1132778']You should create the script while you still have mems and if anything messes up we will pay for your mems :p
I dont have membs, and dont wanna get again. I kind of lost my motivation to runescape since levels means nothing for pking, all you need is level 50s in f2p to unlock all the items/abilities...
I would make a combat scipt for f2p, but because of the low level monsters and weaknesses its hard to make decent xp.

Ilya
11-28-2012, 07:27 PM
I dont have membs, and dont wanna get again. I kind of lost my motivation to runescape since levels means nothing for pking, all you need is level 50s in f2p to unlock all the items/abilities...
I would make a combat scipt for f2p, but because of the low level monsters and weaknesses its hard to make decent xp.
you could attempt an f2p revenant/hellhound/greater demon slayer.

Shatterhand
11-29-2012, 08:34 AM
you could attempt an f2p revenant/hellhound/greater demon slayer.
They are all in wilderness? :(

chief herb
11-29-2012, 09:58 AM
idk ankou, or a hill giant killer with bonecrusher support. im not sure, not too many ideas for f2p that arent taken

John
11-29-2012, 10:58 AM
idk ankou, or a hill giant killer with bonecrusher support. im not sure, not too many ideas for f2p that arent taken

I could surely lend one of my accounts to you so you could get this up and running again with abilities.

Shatterhand
12-03-2012, 10:04 AM
I could surely lend one of my accounts to you so you could get this up and running again with abilities.
There is no point to kill Moss giants anymore. They are too low level, with level 140+ you wont get any good xp from them.
I managed to get my AIO fighter working on red spiders. It seems they are the best monsters to train on, but needs a lot of food, so its not that effective. The script uses abilities.
Heres a proggy I got in F2P!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ShatterFighter v1.0
* Time Running: 22 Minutes and 14 Seconds
* ATK XP Gained: 23203 (62583)
* ATK Level: 8x
* XP till next: 35441
* Food: 5 Hops: 0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Failed to eat.
Another problem is the crashers, if you attack a monster first, you will get the xp. There are many annoying players who tag all the monsters so we get no xp...

qingqinghd
12-03-2012, 04:10 PM
{$DEFINE SMART}
program ChaosMossKiller;
{$i srl/srl.simba}
{$i sps/sps.simba}
{$i srl/srl/misc/SmartGraphics.simba}
{$i srl/srl/misc/debug.simba}

const
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
//================================================== ============================
//=====================ChaosMossKiller by ShatterHand=======================v7.2
//================================================== =======================9 Nov
SRLStats_User = ''; // Your SRL Stats ID (If you dont have one then just leave it as it is)
SRLStats_Password = ''; // Your SRL Stats Password (If you dont have one then just leave it as it is)

Username = '';
Password = '';

TrainedSkill = 'Strength'; // Level tracking: 'Attack', 'Strength', 'Defence', 'Range', 'Hitpoints'. Use 'TOTAL' for no level tracking, all xp will be counted.
GoalLevel = 99; // Script will stop when goal reached.
XPCounter = 2; // Right click on XP button, and set up a counter for Trained Skill. You can have 3 counters maximum. XPCounter should be 1, 2 or 3.

EatAt = 2000;
BonesToPeaches = True; // B2P must be on the 28th slot!
PickUpLoots = False; // Loots items from the list (line 1344). Drop junks and move items to first slots before start!

UseSpecAttacks = False; // Only primary weapons. Dont use Korasi! (multi spec)
SpecUsage = 50; // 25, 50, 55, 60, 100

AmmoType = 'Broad'; // UpText for Ammo (will equip it if looted accidently)

TakeScreenShots = False; // Takes screenshots on levelups and stops. Small sized jpg.
ScreenShotsPath = 'C:\Simba\Screenshots\ChaosMossKiller\'; // Create the folder manually!!!


PaintStatus = True;
PaintReport = True;
PaintDebug = True;

DebugWindow = False;
DebugLines = False;
//================================================== ============================
//===========UPDATES: http://villavu.com/forum/showthread.php?t=74029===========
//================================================== ============================
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Version = 'v7.2';



var //global variables
BonesX, BonesY, X, Y,
StartTime, StartXp, NextLevelAt, TrainedLevel, HpLevel,
WorldHops, B2PUsed, FoodUsed, GoldCharms, GreenCharms, BlueCharms, CrimsonCharms,
SpecWait, SpecTime, SpecNumber,
LastHitXP, LastHitTime,
InvIndex : Integer;
LevelString : String;
DoReport, b2p : Boolean;
Loots : Array of String;



procedure DeclarePlayers; //for login
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
with Players[0] do
begin
Name := UserName;
Pass := Password;
Active := True;
Member := True;
end;
end;



//CREDITS TO FLIGHT
procedure BrakeWindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, targetArea: extended);
var
veloX, veloY, windX, windY, veloMag, dist, randomDist, lastDist, D : extended;
lastX, lastY, MSP, W, TDist, T : integer;
sqrt2, sqrt3, sqrt5, PDist, maxStep : extended;
begin
MSP := MouseSpeed;
sqrt2:= sqrt(2);
sqrt3:= sqrt(3);
sqrt5:= sqrt(5);

TDist := Distance(Round(xs), Round(ys), Round(xe), Round(ye));
if (TDist < 1) then
TDist := 1;
MarkTime(T);
repeat
if (TimeFromMark(T)>5000) then
break;

dist:= hypot(xs - xe, ys - ye);
wind:= minE(wind, dist);
if (dist < 1) then
dist := 1;
PDist := (dist/TDist);
if (PDist < 0.01) then
PDist := 0.01;

{
These constants seem smooth to me, but
feel free to modify these settings however
you wish.
}

if (PDist >= 0.15) then //15% (or higher) dist to destination
begin
D := (Round((Round(dist)*0.3))/5);
if (D < 20) then
D := 20;
end else if (PDist < 0.15) then
begin
if ((PDist <= 0.15) and (PDist >= 0.10)) then //10%-15%
D := RandomRange(8, 13)
else if (PDist < 0.10) then //< 10%
D := RandomRange(4, 7);
end;

if (D <= Round(dist)) then
maxStep := D
else
maxStep := Round(dist);

if dist >= targetArea then
begin
windX:= windX / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
windY:= windY / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
end else
begin
windX:= windX / sqrt2;
windY:= windY / sqrt2;
end;

veloX:= veloX + windX;
veloY:= veloY + windY;
veloX:= veloX + gravity * (xe - xs) / dist;
veloY:= veloY + gravity * (ye - ys) / dist;

if (hypot(veloX, veloY) > maxStep) then
begin
randomDist:= maxStep / 2.0 + random(round(maxStep) div 2);
veloMag:= sqrt(veloX * veloX + veloY * veloY);
veloX:= (veloX / veloMag) * randomDist;
veloY:= (veloY / veloMag) * randomDist;
end;

lastX:= Round(xs);
lastY:= Round(ys);
xs:= xs + veloX;
ys:= ys + veloY;

if (lastX <> Round(xs)) or (lastY <> Round(ys)) then
MoveMouse(Round(xs), Round(ys));

W := (Random((Round(100/MSP)))*6);
if (W < 5) then
W := 5;
W := Round(W*1.2);
wait(W);
lastdist:= dist;
until(hypot(xs - xe, ys - ye) < 1)

if (Round(xe) <> Round(xs)) or (Round(ye) <> Round(ys)) then
MMouse(Round(xe), Round(ye), 0, 0);

MouseSpeed := MSP;
end;



//CREDITS TO FLIGHT
procedure BrakeMMouse(eX, eY, ranX, ranY: Integer);
var
randSpeed : extended;
X, Y, MS : integer;
begin
MS := MouseSpeed;
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
GetMousePos(X, Y);
BrakeWindMouse(X, Y, RandomRange(eX-ranX, eX+ranX), RandomRange(eY-ranY,eY+ranY), 8, 5, 10.0 / randSpeed, 15.0 / randSpeed, 10.0 * randSpeed);
MouseSpeed := MS;
end;



procedure RandomMMouse(eX, eY, ranX, ranY: Integer);
begin
case Random(2) of
0: BrakeMMouse(eX,eY,ranX,ranY);
1: MMouse(eX,eY,ranX,ranY);
end;
end;



procedure MakeScreenShot(const FilePath : String); //makes small sized jpg screenshot
var //example for FilePath 'C:\Simba\Screenshots\ChaosMossKiller\levelups'
fileName : String;
Year, Month, Day : Word;
i : Integer;
begin
if TakeScreenShots then
begin
if not DirectoryExists(ScreenShotsPath) then
CreateDirectory(ScreenShotsPath);
if not DirectoryExists(FilePath) then
CreateDirectory(FilePath);
DecodeDate(Date,Year,Month,Day);
i := 0;
repeat
i := i+1;
FileName := ToStr(Year) + '-' + ToStr(Month) + '-' + ToStr(Day) + ' (' + IntToStr(i) + ').jpg';
until not FileExists(FilePath + FileName)
SaveScreenShot(FilePath + FileName); //example for filename '2012-3-21 (1).jpg'
end;
end;



procedure DebugMossies(TPA: TPointArray; ATPA: Array of TPointArray; Box: TBox);
var
BMP, Color, x, y, i : Integer;
TPABox : TBox;
begin
BMP := BitmapFromClient(0,0,MSX2,MSY2); //making a bitmap, adding the mainscreen image to it
DrawTPABitmap(BMP,TPA,ClRed); //adding TPA to the bitmap

if TPABox.x1 < 0 then TPABox.x1 := 0;
if TPABox.x1 > MSX2 then TPABox.x1 := MSX2;

if TPABox.x2 < 0 then TPABox.x2 := 0;
if TPABox.x2 > MSX2 then TPABox.x2 := MSX2;

if TPABox.y1 < 0 then TPABox.y1 := 0;
if TPABox.y1 > MSY2 then TPABox.y1 := MSY2;

if TPABox.y2 < 0 then TPABox.y2 := 0;
if TPABox.y2 > MSY2 then TPABox.y2 := MSY2;

if Box.x1 < 0 then Box.x1 := 0;
if Box.x1 > MSX2 then Box.x1 := MSX2;

if Box.x2 < 0 then Box.x2 := 0;
if Box.x2 > MSX2 then Box.x2 := MSX2;

if Box.y1 < 0 then Box.y1 := 0;
if Box.y1 > MSY2 then Box.y1 := MSY2;

if Box.y2 < 0 then Box.y2 := 0;
if Box.y2 > MSY2 then Box.y2 := MSY2;

for i := 0 to high(ATPA) do
begin
if i = 0 then
Color := ClYellow
else
Color := ClBlack;

TPABox := GetTPABounds(ATPA[i]); //getting the box of the TPAs
for x := TPABox.x1 to TPABox.x2 do
begin
FastSetPixel(BMP,x,TPABox.y1,Color)
FastSetPixel(BMP,x,TPABox.y2,Color)
end;
for y := TPABox.y1 to TPABox.y2 do
begin
FastSetPixel(BMP,TPABox.x1,y,Color)
FastSetPixel(BMP,TPABox.x2,y,Color)
end;
end;

for x := Box.x1 to Box.x2 do //this is for the dead Moss giant
begin
FastSetPixel(BMP,x,Box.y1,ClRed)
FastSetPixel(BMP,x,Box.y2,ClRed)
end;
for y := Box.y1 to Box.y2 do
begin
FastSetPixel(BMP,Box.x1,y,ClRed)
FastSetPixel(BMP,Box.x2,y,ClRed)
end;

DebugBitmap(BMP);
FreeBitmap(BMP);
end;



procedure DebugPoints(TPA: TPointArray; ATPA: Array of TPointArray);
var
BMP, Color, x, y, i : Integer;
TPABox : TBox;
begin
BMP := BitmapFromClient(0,0,MSX2,MSY2); //making a bitmap, adding the mainscreen image to it
DrawTPABitmap(BMP,TPA,ClRed); //adding TPA to the bitmap

for i := 0 to high(ATPA) do
begin
if i = 0 then
Color := ClYellow
else
Color := ClBlack;

TPABox := GetTPABounds(ATPA[i]); //getting the box of the TPAs
for x := TPABox.x1 to TPABox.x2 do
begin
FastSetPixel(BMP,x,TPABox.y1,Color)
FastSetPixel(BMP,x,TPABox.y2,Color)
end;
for y := TPABox.y1 to TPABox.y2 do
begin
FastSetPixel(BMP,TPABox.x1,y,Color)
FastSetPixel(BMP,TPABox.x2,y,Color)
end;
end;

DebugBitmap(BMP);
FreeBitmap(BMP);
end;



procedure StatusWithPaint(What: String);
begin
Status(What);
if PaintStatus then
begin
SMART_ClearCanvasArea(IntToBox(MSX1,320+50,MSX2,34 3+50)); //clears the previous text
SMART_DrawTextEx(false,8,322,UpChars,What,ClWhite) ; //draws the new text
end;
end;



function CurrentTime: String; //function for time display, example: [17:53:59]
var
Hour, Mins, Sec, MSec: Word;
begin
DecodeTime(Now, Hour, Mins, Sec, MSec);
Result := ('['+Padz(IntToStr(Hour), 2) + ':' + Padz(IntToStr(Mins), 2) + ':' + Padz(IntToStr(Sec), 2)+'] ');
end;



procedure EndScript(Reason: String); //function for terminating, message box will pop up
begin
MakeScreenShot(ScreenShotsPath + 'stops\');
Disguise('Stopped');
Writeln(CurrentTime + Reason);
PlaySound('C:\Simba\sound.wav');
//MessageBox(CurrentTime + Reason,'ChaosMossKiller',0);
end;



procedure Antiban; //basic antibans
begin
case Random(2400) of
0..1:
begin
if TrainedSkill = 'TOTAL' then Exit;
StatusWithPaint('Checking trained level.');
HoverSkill(TrainedSkill,false);
Wait(RandomRange(1000,3000));
GameTab(tab_Inv);
end;
10..11:
begin
StatusWithPaint('Checking random level.');
HoverSkill('random',false);
Wait(RandomRange(1000,3000));
GameTab(tab_Inv);
end;
20..21:
PickUpMouse;
30..39:
CompassMovement(-180,180,false);
40:
begin
if LevelString = 'RNG' then
begin
StatusWithPaint('Checking equipments.');
GameTab(tab_Equip);
Wait(RandomRange(1000,3000));
GameTab(tab_Inv);
end;
end;
100..400:
SleepAndMoveMouse(RandomRange(300,1200));
end;
end;



procedure AmmoCheck; //removes weapon if needed to prevent death, then terminates
var
i : Integer;
done : Boolean;
begin
if LevelString = 'RNG' then
if FindChatBoxText('You have no ammo',8,ClBlack) then
begin
StatusWithPaint('Out of ammo.');
Wait(1000);
if srl_inFight then
begin
StatusWithPaint('Still fighting, removing weapon.');
GameTab(tab_Inv);
if InvFull then
begin
i := 1;
done := False;
repeat
MMouseItem(i);
if IsUpTextMultiCustom(['Bury','Eat']) then
if DropItem(i) then
done := True;
Inc(i);
until done
end;
GameTab(tab_Equip);
if WearingItem(5) then
TakeOff(5);
StatusWithPaint('Removed weapon.');
EndScript('Out of ammo.');
end;
end;
end;



procedure BreakB2P; //breaks b2p tablet, terminates if out of it
var
X, Y, PeachDTM, FailTime : Integer;
begin
PeachDTM := DTMFromString('78DA632C60626070626440069B3B5219448 0344C94310FA8C60C550D030313AA9A32A01A0B026A6A806A1 C08A8A906AA7127A006E4663F026A52883007A4C69E809A4CC 2FE0200D76708C1');

MarkTime(FailTime);
repeat
MarkTime(FailTime); //extending time for fails
GameTab(tab_Inv);
InvMouse(28,mouse_move); //b2p must be on 28th slot (had some problems creating DTM for it...)
if WaitUpText('Break',200) then
begin
StatusWithPaint('Breaking B2P.');
ClickMouse2(mouse_left);
if WaitFindDTMEx(PeachDTM,X,Y,MIX1,MIY1,MIX2,MIY2,100 ,10000) then //peach found
begin
Inc(B2PUsed);
FreeDTM(PeachDTM);
Exit;
end else
if FindChatBoxText('any bones',8,ClBlack) then
EndScript('Ouf of bones.');
end;
if (TimeFromMark(FailTime) > 10000) then
EndScript('Cant find B2P tablets.');
until False

FreeDTM(PeachDTM);
end;



function EatFood(FoodString: String): Boolean; //returns False if no food found
var
X, Y, FoodDTM, EatTime, WaitTime, i : Integer;
begin
FoodDTM := DTMFromString(FoodString);

Result := True;
GameTab(tab_Inv);
if WaitFindDTMEx(FoodDTM,X,Y,MIX1,MIY1,MIX2,MIY2,100, 1000) then //food found
begin
StatusWithPaint('Eating.');
i := InvCount;
Mouse(X,Y,5,5,mouse_left);
WaitTime := RandomRange(2000,3000);
MarkTime(EatTime);
repeat
if (InvCount < i) then
begin
Inc(FoodUsed);
Dec(i);
end;
until (TimeFromMark(EatTime) > WaitTime)
end
else
Result := False;
//no food found
FreeDTM(FoodDTM);
end;



procedure HpCheck; //eats if HP is below EatAt. uses b2p. eats to full without wasting
var
colorstring, Lobster, Peach : String;
Amount : Integer;
done : Boolean;
begin

if (GetMMLevels('hp', colorstring) < EatAt) then
begin
repeat
if not b2p then //eats lobsters first
begin
Amount := 120; //healing amount of lobster
Lobster := 'mggAAAHicY2NgYPjPxMDAzczAwMcMYX8E4p9ALMbIwMAKxNxA rMAI4fMC8f4EGaAuJgwsAiSxYUYcGAIAcgoGSA==';
if not EatFood(Lobster) then //if cant find lobster
begin
if not BonesToPeaches then //if not using B2P, then terminates
EndScript('Out of food.')
else
b2p := True; //turns on b2p
end;
end;
if b2p then
begin
Amount := 80; //healing amount of peach
Peach := '78DA633CCCC4C0F0809101196C6E4F66F802148289321E02A AB982AA8681810955CD59A09AEB986AB81890D45C00AAB94F4 0CD49A09AD704D4EC02AA794140CD0EA09A3BF8D500007F980 F5F'
if not EatFood(Peach) then //if out of peaches
begin
BreakB2P;
EatFood(Peach);
end;
end;
if (GetMMLevels('hp', colorstring) + Amount) > (HpLevel * 10 ) then //if no need to eat more (CurrentHP + HealAmount > MaxHP)
done := True;
until done
end;
end;



function FindMoss(ClickOnIt: Boolean) : Boolean; //returns True if clicked on a Moss giant
var
TPA, TempTPA : TPointArray;
ATPA : Array of TPointArray;
X, Y, RedX, RedY, ExcX, ExcY, i, MinPoints, DetectTime, UptextTime, RedBarDTM : Integer;
Colors, Tolerances : Array of Integer;
begin
Result := False;
MarkTime(DetectTime);
MinPoints := 100;
//6257521 (8) portal színe, tökéletes
//2173227 (5) nincs már sötét fal (eddig 7 jó volt)
//2372406 (8) nincs már (12 volt) nagyon kicsi barna fából
//2309694 (7) nincs nagyon nagyon kicsi barna fából
//3303025 (14) sárgásbarna, tökéletes
//4482405 (13)
Colors := [6257521, 2173227, 2372406, 2309694, 3303025, 4482405];
Tolerances := [8, 5, 8, 7, 15, 13 ];

for i:=0 to High(Colors) do
begin
FindColorsTolerance(TempTPA,Colors[i],MSX1,MSY1,MSX2,MSY2,Tolerances[i]);
AppendTPA(TPA,TempTPA);
end;

if (High(TPA)> 0) then
begin

RedBarDTM := DTMFromString('mWAAAAHicY2FgYNgCxOeh+AIQRwFxOBDHQt k7GTgYrNmZ4FgEKIaMGdEwCAAAoEoGcA==');
if WaitFindDTMex(RedBarDTM,X,Y,MSX1,MSY1,MSX2,MSY2,10 ,100) then //excluding points near RedHpBar
begin
RedX := X; //middle of the redbar
RedY := Y+50;
ExcX := 35; //excluding distance
ExcY := 60;
SortTPAFrom(TPA,Point(RedX,RedY));
InvertTPA(TPA);
for i:=0 to High(TPA) do
if (Abs(TPA[i].x - RedX) < ExcX) and (Abs(TPA[i].y - RedY) < ExcY) then
Break;
if i = 0 then
begin
FreeDTM(RedBarDTM);
Exit;
end;
SetArrayLength(TPA,i);
end;
FreeDTM(RedBarDTM);

SortTPAFrom(TPA,Point(MSCX,MSCY)); //excluding points near middle
InvertTPA(TPA);
for i:=0 to High(TPA) do
if (Abs(TPA[i].x - MSCX) < 25) and (Abs(TPA[i].y - MSCY) < 25) then
Break;
if i = 0 then Exit;
SetArrayLength(TPA,i);

ATPA := SplitTPA(TPA,10); //splitting TPAs

SortATPASize(ATPA,True); //excluding TPAs with less than MinPoints points
for i:=0 to High(ATPA) do
begin
if High(ATPA[i]) < MinPoints then
Break;
end;
if i = 0 then Exit;
SetArrayLength(ATPA,i);

SortATPAFromFirstPoint(ATPA,Point(MSCX,MSCY)); //making the closest TPA the first in the array

if DebugWindow then //DebugWindow
DebugMossies(TPA,ATPA,IntToBox(RedX-ExcX,RedY-ExcY,RedX+ExcX,RedY+ExcY));

if ClickOnIt then
begin
if MiddleTPAEx(ATPA[0],X,Y) then //getting the middle point of the TPA, moving mouse there then looking for uptext
begin
MMouse(X,Y,0,0);
MarkTime(UptextTime);
if WaitUpTextMulti(['Attack','ttack','Moss'],200) then
begin
if DebugLines then //DebugLines
Writeln('Found Moss in ' + IntToStr(TimeFromMark(DetectTime)) + ' ms. Uptext was ' + IntToStr(TimeFromMark(UptextTime)) + ' ms.');
case Random(6) of //random left or right click (5:1)
0..4:
begin
ClickMouse2(mouse_left);
if DidRedClick then
Result := True; //clicked on moss
Exit;
end;
5:
begin
ClickMouse2(mouse_right);
if ChooseOption('Attack') then
Result := True;
Exit;
end;
end;
end else
if DebugLines then //DebugLines
Writeln('Found Moss in ' + IntToStr(TimeFromMark(DetectTime)) + ' ms, but failed to find UpText.');
end;
end else
if DebugLines then //DebugLines
Writeln('Found Mosses in ' + IntToStr(TimeFromMark(DetectTime)) + ' ms.');
end;
end;



function FindBones(): Array of TPoint; //returns the bones' middle points as a TPA
var
TPA, TempTPA : TPointArray;
ATPA : Array of TPointArray;
CTS, Time, MinPoints, i, Which : Integer;
Colors, Tolerances : Array of Integer;
HueMods, SatMods : Array of Extended;
begin

MarkTime(Time);

MinPoints := 10;
Colors := [12895698, 13356502, 12567496];
Tolerances := [11, 6, 6 ];
HueMods := [0.11, 0.43, 0.20 ];
SatMods := [0.76, 0.85, 0.60 ];

CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
for i:=0 to High(Colors) do
begin
SetToleranceSpeed2Modifiers(Huemods[i],SatMods[i]);
FindColorsTolerance(TempTPA,Colors[i],MSX1,MSY1,MSX2,MSY2,Tolerances[i]);
AppendTPA(TPA,TempTPA);
end;
ColorToleranceSpeed(CTS);

if (High(TPA)> 0) then
begin

SortTPAFrom(TPA,Point(MSCX,MSCY)); //excluding points near middle
InvertTPA(TPA);
for i:=0 to High(TPA) do
if (Abs(TPA[i].x - MSCX) < 15) and (Abs(TPA[i].y - MSCY) < 15) then
Break;
if i = 0 then Exit;
SetArrayLength(TPA,i);

ATPA := SplitTPA(TPA,10); //splitting the TPA

SortATPASize(ATPA,true); //excluding TPAs with less than MinPoints points
for i:=0 to High(ATPA) do
begin
if High(ATPA[i]) < MinPoints then
Break;
end;
if i = 0 then Exit;
SetArrayLength(ATPA,i);

SortATPAFromFirstPoint(ATPA,Point(MSCX,MSCY)); //first TPA is the closest to middle

if DebugWindow then //DebugWindow
DebugPoints(TPA,ATPA);

SetLength(Result,Length(ATPA)); //setting up the Result array
if (Length(ATPA) > 0) then
for i:=Low(ATPA) to High(ATPA) do
begin
if MiddleTPAEx(ATPA[i],X,Y) then
begin
Result[i] := Point(X,Y); //copying the values
end;
end;
end;

end;



function WaitInvChange(Timeout: Integer) : Boolean; //returns True if pixels changed in inventory (usage: counting charms)
var
Time : Integer;
begin
MarkTime(Time);
repeat
if (PixelShift(IntToBox(MIX1,MIY1,MIX2,MIY2),50) > 1) then
begin
Result := True;
Exit;
end;
until (TimeFromMark(Time) > TimeOut)
Result := False;
end;



function WaitInFight(Timeout: Integer) : Boolean; //returns True if XP is increased or blue shield is found
var
X, Y, XP1, XP2, ShieldDTM, Time : Integer;
begin
MarkTime(Time);
ShieldDTM := DTMFromString('mbQAAAHicY2VgYFBhhGAtIDaE0q+B4l+A+D cQvwTir0DMYu0Jx3///mXgqN/KwAUUR8eMWDAYAAD4KAuS');
repeat
if (XP2 > XP1) then
begin
if DebugLines then
Writeln('XP is increased, we are fighting.');
if PaintDebug then
begin
SMART_DrawBoxEx(false,false,IntToBox(524,104-50,543,123-50),ClYellow); //drawing box on xp button
Wait(50);
SMART_ClearCanvasArea(IntToBox(520,100,547,127));
end;
Result := True;
FreeDTM(ShieldDTM);
Exit;
end;
if (TimeFromMark(Time) > 3000) and FindDTM(ShieldDTM,X,Y,MSX1,MSY1,MSX2,MSY2) then
begin
if DebugLines then
Writeln('Blue shield found, we are fighting.');
Result := True;
FreeDTM(ShieldDTM);
Exit;
end;
until (TimeFromMark(Time) > Timeout)
FreeDTM(ShieldDTM);
Result := False;
end;



function InFight: Boolean; //returns True if fighting
begin //LastHitXP and LastHitTime are global variables
begin
MarkTime(LastHitTime);
Result := True;
Exit;
end;
if (TimeFromMark(LastHitTime) > 10000) then
begin
Result := False;
Exit;
end;
Result := True;
end;



function FindRedBar : Boolean; //returns True if a full red hp bar is found
var
X, Y, RedBarDTM1, RedBarDTM2 : Integer;
begin
Result := False;
RedBarDTM1 := DTMFromString('mlwAAAHicY2dgYDBnZmCQBWIZKB0ExQpA3A iUr2OA0C1QDOPvZOBgsGZnwsBdDIwM+AAjHgwFAAvPB5w='); //two DTMs just in case
RedBarDTM2 := DTMFromString('mlwAAAHicY2dgYDBnZmCQBWIZKB0ExQpA3A iUr2OA0C1QDOPvZOBgsGZnwsBdDIwM+AAjHgwFAAvPB5w=');

if FindDTM(RedBarDTM1,X,Y,MSX1,MSY1,MSX2,MSY2) or
FindDTM(RedBarDTM2,X,Y,MSX1,MSY1,MSX2,MSY2) then
begin
if DebugLines then
Writeln('Found redbar, we killed it.');
if PaintDebug then
begin
SMART_DrawBoxEx(false,false,IntToBox(X-30,Y-10,X+30,Y+10),ClYellow); //drawing box around the redbar
Wait(50);
SMART_ClearCanvasArea(IntToBox(0,MSY1+49,520,MSY2+ 50));
end;
Result := True;
end;
FreeDTM(RedBarDTM1);
FreeDTM(RedBarDTM2);
end;



procedure ClearInv; //arranges inventory, keeps the slot of InvIndex empty, drops accidently picked up junks
var
i : Integer;
DropItems : Array of String;
begin
if not PickUpLoots then
Exit;

if InvIndex = 28 then
EndScript('Inventory is full.');

DropItems :=[
'Whiteberry s','Jangerberry','Marrentill','Black sq','Black f','Magic st','Air r','Chaos r','Earth r',
'Steel b','Mithril s'
];

if ExistsItem(InvIndex) then
begin
MouseItem(InvIndex,mouse_move);

if IsUptext('Use') and not IsUpText('Bury') and not IsUpText('Eat') then
begin
MakeScreenShot(ScreenShotsPath + 'invinc\');
Inc(InvIndex);
Wait(RandomRange(300,800));
end
else
if InvFull then
begin
ClickMouse2(mouse_right);
ChooseOption('Drop');
Wait(RandomRange(300,800));
Exit;
end
else
for i:=InvIndex+1 to 27 do
begin
if not ExistsItem(i) then
begin
DragItem(InvIndex,i);
Wait(RandomRange(300,800));
Exit;
end;
end;



end;

if PaintDebug then
begin
SMART_ClearCanvasArea(IntToBox(MIX1,MIY1+50,MIX2,M IY2+50));
SMART_DrawBoxEx(false,false,InvBox(InvIndex),ClBla ck);
end;
end;



function Loot(PickUpBones: Boolean): Integer; //-1: nothing looted, else number of items left to loot
var
B: TBox;
i, j, x: Integer;
T: TPoint;
Options: Array of TOptions;
HowManyToLoot, OptionsArrayNumber, LootsArrayNumber : Integer;
begin
Result := -1;
HowManyToLoot := 0;
OptionsArrayNumber := -1;

Options := GetChooseOptions('action');
if (Length(Options) < 1) then
Exit;

if PickUpLoots then
begin
for i := 0 to High(Loots) do //checking each items wether they match with the options
for j := 0 to High(Options) do
begin
if Pos('Take ' + Loots[i], Options[j].Str) > 0 Then
begin
Inc(HowManyToLoot); //+ 1 to loot
if OptionsArrayNumber = -1 then //if its first match it will be the first to loot
begin
LootsArrayNumber := i; //the item's number in the loots list
OptionsArrayNumber := j; //the items's number in the options list
end;
end;
end;
end;

if not (OptionsArrayNumber = -1) then //-1 means nothing to loot
begin
case LootsArrayNumber of
0..3: StatusWithPaint('Found a ' + Loots[LootsArrayNumber] + ' charm!');
4..36: StatusWithPaint('Found item: ' + Loots[LootsArrayNumber]);
end;

B := Options[OptionsArrayNumber].Bounds;
GetMousePos(T.x, T.y);
if PointInBox(T, B) then
ClickMouse2(mouse_left)
else
MouseBoxEx(B.x1+5,B.Y1,B.x2-5,B.Y1+5,5,mouse_left);

if WaitInvChange(5000) then
begin
case LootsArrayNumber of
0: Inc(GoldCharms);
1: Inc(GreenCharms);
2: Inc(CrimsonCharms);
3: Inc(BlueCharms);
end;
end;
Result := HowManyToLoot-1;
Exit;
end;

if PickUpBones then
for i := 0 to High(Options) do
begin
if Pos('Take Big', Options[i].Str) > 0 Then
begin
StatusWithPaint('Found bones.');

B := Options[i].Bounds;
GetMousePos(T.x, T.y);
if PointInBox(T, B) then
ClickMouse2(mouse_left)
else
MouseBoxEx(B.x1+5,B.Y1,B.x2-5,B.Y1+5,5,mouse_left);

WaitInvChange(5000);
//repeat until not IsMoving
Result := 0;
Exit;
end;
end;

//B := Options[0].BigBox;
//x := Max(B.X1-52,0);
//if x = 0 then
//x := B.X2+10;
//MMouse(x,Max(B.Y1-50,0),40,B.Y2-B.Y1);

GetMousePos(X,Y); //more human-like 'moving mouse away'
B := Options[0].BigBox;
MMouse(RandomRange(X-30,X+30),RandomRange(B.Y1-40,B.Y1-80),0,0);

Wait(RandomRange(300,800));
end;



procedure LootPileCheck; //checks more bones randomly, exits after 1 pickup
var
i, Res : Integer;
Bones : Array of TPoint;
LootBones : Boolean;
begin
ClearInv;

if InvCount < 27 then
LootBones := True
else
LootBones := False;

Bones := FindBones;
if (Length(Bones) > 0) then
begin
StatusWithPaint('Checking loots.');
for i:=Low(Bones) to High(Bones) do
begin
case Random(2) of
0:
begin
RandomMMouse(Bones[i].x,Bones[i].y,0,0);
ClickMouse2(mouse_right);
Res := Loot(LootBones);
ClearInv;
if Res > 0 then
begin
for i:=1 to Res do
begin
repeat until not IsMoving
RandomMMouse(MSCX,MSCY,5,5);
ClickMouse2(mouse_right);
Loot(False);
ClearInv;
end;
end;
if not (Res = -1) then
Exit; //positions changed, cant check more
end;
end;
end;
end;
end;



procedure HopWorld;
begin
StatusWithPaint('Hopping.');
WorldHops := WorldHops+1;

repeat
ExitToLobby;
LoginPlayerToLob; //in case we get kicked out to login screen
until LobbyScreen;

OpenWorldScreen;
SelectWorld(RandomWorld(true,false));

repeat
LoginPlayer;
until LoggedIn

Wait(RandomRange(3000,6000));

SmartSetDebug(True);
SmartSetRefresh(100);
if not SmartEnabled then
SmartSetEnabled(True);

ExitSquealOfFortune;
SetAngle(SRL_ANGLE_HIGH);

end;



procedure WalkToCenter; //simple SPS
begin
StatusWithPaint('Walking to center.');
SPS_WalkToPos(Point(335, 374));
end;



procedure SpecialAttack; //does special attacks in random times
var
X, Y, DTM100, DTM75, DTM60, DTM55, DTM50, DTM25, FailTime : Integer;
begin
if (UseSpecAttacks) and ((TimeFromMark(SpecTime) > SpecWait) or (SpecNumber > 0)) then //if specials are turned on and (if its time to check for special or we have remaining specials to do)
begin
StatusWithPaint('Checking special attack.');
DTM100 := DTMFromString('mWAAAAHicY2FgYHBgYmCwB+IjULyQkYFhHR AvAOI1QFyzIo9BSl+EwT/XkiGi2oGBC6gHGTOiYRAAAPnmCNY='); //DTMS for 100%,75% ... special bars
DTM75 := DTMFromString('mQwAAAHicY2ZgYLBnguAFIMzIwLAWiJcBsX OyIYOmpwJDep83AxdQHQwzImEgAAD6tQXo');
DTM60 := DTMFromString('mQwAAAHicY2ZgYHBgYmCwB+IuIF7EyMCwhh FCt2wuZTDyUmWYcKSegQuoDoYZkTAQAAAooAdH');
DTM55 := DTMFromString('mQwAAAHicY2ZgYGhmgeDjQCzNxMCgCcSyQO ycbMggpS/CMOFIPQMXUB0MMyJhIAAA5cgFbA==');
DTM50 := DTMFromString('mQwAAAHicY2ZgYHBgYmCwB+JaIF7EyMCwhh FCt2wuZTDyUmWYcKSegQuoDoYZkTAQAAAl1Qc6');
DTM25 := DTMFromString('mQwAAAHicY2ZgYHBgYmCwB+IoIF7EyMCwhh FCt2wuZTDyUmWYcKSegQuoDoYZkTAQAAAeUAcX');
SpecNumber := 0;
MarkTime(FailTime);

GameTab(tab_Combat);
SpecNumber := 0; //determining how many specials we can do
case SpecUsage of
100:
if FindDTM(DTM100,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
75:
if FindDTM(DTM75,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
60:
if FindDTM(DTM60,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
55:
if FindDTM(DTM55,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
50:
begin
if FindDTM(DTM50,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
if FindDTM(DTM100,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 2;
end;
25:
begin
if FindDTM(DTM25,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 1;
if FindDTM(DTM50,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 2;
if FindDTM(DTM75,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 3;
if FindDTM(DTM100,X,Y,MIX1,MIY1,MIX2,MIY2) then
SpecNumber := 4;
end;
end;
MarkTime(SpecTime);
SpecWait := RandomRange(15000,60000); //next spec check in 15-60 seconds
if SpecNumber > 0 then //if we have enough spec
begin
StatusWithPaint('Using special attack.');
MouseBox(574,416,706,428,mouse_left);
Dec(SpecNumber);
end else //if not enough
StatusWithPaint('Not enough special.');

Wait(RandomRange(1000,1500));

GameTab(tab_Inv);
FreeDTM(DTM100);
FreeDTM(DTM75);
FreeDTM(DTM60);
FreeDTM(DTM55);
FreeDTM(DTM50);
FreeDTM(DTM25);
end;
end;



procedure NoobCheck; //looks for people around, waits a bit then changes world. exits if they are gone for 3 seconds
var
MX, MY, NoobsAround, Time, WaitTime, Count : Integer;
begin

MX := 627; //minimap's middle point
MY := 136-50;
NoobsAround := Length(GetMinimapDotsin('player',MX-28,MY-28,MX+28,MY+28));

if NoobsAround > 0 then
begin
if PaintDebug then
SMART_DrawBoxEx(false,false,IntToBox(MX-28,MY-28,MX+28,MY+28),ClRed);
WaitTime := RandomRange(8000,12000);

MarkTime(Time);
repeat
StatusWithPaint('Noobs around, waiting... ' + IntToStr((WaitTime-TimeFromMark(Time))/1000));
NoobsAround := Length(GetMinimapDotsin('player',MX-28,MY-28,MX+28,MY+28));
if NoobsAround = 0 then
Inc(Count);
if Count > 5 then //if cant see noobs anymore for 3 seconds
begin
StatusWithPaint('Noobs gone.');
if PaintDebug then
SMART_ClearCanvasArea(IntToBox(MMX1,MMY1+50,MMX2,M MY2+50));
Exit;
end;
Wait(500); //6x500=3000
until (TimeFromMark(Time) > WaitTime)

if PaintDebug then
SMART_ClearCanvasArea(IntToBox(MMX1,MMY1+50,MMX2,M MY2+50));
HopWorld;
end;
end;



procedure SetupScript;
begin
Disguise('ChaosMossKiller');
ClearDebug;

SRL_SixHourFix := True;
Smart_FixSpeed := True;

SetupSRL;
DeclarePlayers;
ClearDebug;

SmartSetRefresh(100);
if not SmartEnabled then
SmartSetEnabled(True);
SMART_ClearCanvas;

SetupSRLStats(680, SRLStats_User, SRLStats_Password);
SPS_Setup(RUNESCAPE_OTHER,['chaos_tunnels']);

LoginPlayer;
end;



procedure OpenActionBar();
begin
writeln('Action bar is closed, opening it');
mmouse(509,335,4,1);
wait(randomrange(10,300));
ClickMouse2(mouse_left);
end;



procedure SetupBar(); //working
var x,y:integer;
begin
if (findcolortolerance(x,y,4013496,40,275,50,287,5)) then
begin
//writeln(inttostr(x)); Testing Purposes
//writeln(inttostr(y)); testing purposes
writeln('Action bar is already open.')
exit;
end;
OpenActionBar;
end;



procedure CheckMomentum(); //checks if adrenaline is full, then activates momentum
var x,y:integer;
begin
if(findcolortolerance(x,y,10221561,465,272,485,292 ,10)) then
begin
wait(randomrange(1,2000))
mmouse(64,312,5,5)
clickmouse2(mouse_left);
writeln('using momentum')
wait(randomrange(500,1000));
mmouse(404,125,50,50) ;
exit;
end;
end;



procedure Startup;
var
CombatLevel, XPTillNext, i : Integer;
begin

Loots :=[
'Gold', 'Green', 'Crimson', 'Blue',
'Yew', 'orstol', 'napdragon', 'Palm', 'Magic se', 'Saradomin', 'toadflax',
'n ranarr', 'Ranarr', 'Rune b', 'Runite', 'Adamant b', 'Adamantite', 'Raw s',
'Blood', 'Death', 'Nature r', 'Pure', 'Earth t', 'Vecna', 'orb', 'Battle',
'Onyx', 'Rune a', 'Dragon d', 'Dragon h', 'Shield l', 'Starved', 'Spin T',
'f weed s', 'me seed', 'Law r', 'Anag'
];


SetChat('off',2);
ExitSquealOfFortune;
SetRun(True);
SetupBar;

CombatLevel := GetCombatLevel;
//if CombatLevel < 85 then
//ShowMessage('WARNING: Your combat level is too low, it is not advised to use this script.');

if srl_inFight then
begin
StatusWithPaint('Waiting till fight is over.');
repeat until not srl_InFight
end;

if not (TrainedSkill = 'TOTAL') then
begin
repeat
StatusWithPaint('Getting trained level.')
TrainedLevel := GetSkillLevel(TrainedSkill);
until not (TrainedLevel = -1)
end;

repeat //need to know hp level for eating
StatusWithPaint('Getting hitpoints level.');
HpLevel := GetSkillLevel('hitpoints');
until not (HpLevel = -1)

if not (TrainedSkill = 'TOTAL') then
begin
if TrainedLevel = 99 then
XPTillNext := 0
else
begin
repeat
StatusWithPaint('Reading XP till next.');
XPTillNext := XPTillNextLevel(TrainedSkill);
until not (XPTillNext = -1);
end;
end;

repeat
StatusWithPaint('Reading XP counter.');
until not (StartXP = -1);

if not (TrainedSkill = 'TOTAL') then
NextLevelAt := StartXP + XPTillNext;

case TrainedSkill of
'Attack' : LevelString := 'ATK';
'Strength' : LevelString := 'STR';
'Defence' : LevelString := 'DEF';
'Range' : LevelString := 'RNG';
'Hitpoints': LevelString := 'HP';
'TOTAL' : LevelString := 'TOTAL';
end;

case DebugLines of
true: DoReport := False;
false: DoReport := True;
end;

b2p := False;
WorldHops := 0;
B2PUsed := 0;
FoodUsed := 0;
GoldCharms := 0;
GreenCharms := 0;
BlueCharms := 0;
CrimsonCharms := 0;

if UseSpecAttacks then
begin
SpecNumber := 0;
SpecWait := RandomRange(15000,45000);
MarkTime(SpecTime);
end;

MarkTime(StartTime);
SetAngle(SRL_ANGLE_HIGH);
GameTab(tab_Inv);

for i:=1 to 28 do
begin
MouseItem(i,mouse_move);
if IsUptextMultiCustom(['Eat','Bury'])or (not ExistsItem(i)) then
begin
InvIndex := i;
Break;
end
end;

ClearDebug;
WriteLn(' ChaosMossKiller ' + Version);
Writeln('');
Writeln(' - Combat level : ' + IntToStr(CombatLevel));
if not (TrainedSkill = 'TOTAL') then
begin
if LevelString = 'HP' then
Writeln(' - ' + LevelString + ' level : ' + IntToStr(TrainedLevel))
else
Writeln(' - ' + LevelString + ' level : ' + IntToStr(TrainedLevel));
Writeln(' - XP till next : ' + IntToStr(XPtillNext));
end else
begin
WriteLn(' - No level tracking.');
WriteLn(' - Counting all xp.');
end;
Writeln(' - XP Bar : ' + IntToStr(StartXP));
Writeln(' - Inv Index : ' + IntToStr(InvIndex));
WriteLn(' - Starting script...');

end;



procedure Main;
var
DetectTime, KillTime : Integer;
done : Boolean;
begin
repeat

StatusWithPaint('Looking for Mosses.');
done := False;
MarkTime(DetectTime);
repeat
if (TimeFromMark(DetectTime) > 300000) then //300 seconds failsafe (SMART restart needs time)
EndScript('Not in fight for too long.');

NoobCheck;

checkmomentum();

if FindMoss(true) then //if clicked on moss
begin
if WaitInFight(6000) then //if xp is increased or blue shield found
done:=True
end
else //if failed to attack moss
begin
StatusWithPaint(IntToStr(Round(TimeFromMark(Detect Time)/1000)));
case Random(20) of
0: CompassMovement(-120,120,false); //rotating camera for better view
end;
if (TimeFromMark(DetectTime) > 10000) then //walking back to middle
WalkToCenter;
end;
until done

//for InFight
MarkTime(LastHitTime); //for InFight
MarkTime(KillTime);
repeat
StatusWithPaint('Fighting.');
Antiban;
AmmoCheck;
checkmomentum();
if (TimeFromMark(KillTime) < 5000) then //using specials only in the first 5 seconds to avoid wasting it on small hit
SpecialAttack;
if ((TimeFromMark(KillTime) > 3500) and (FindRedBar)) then //looking for redbar after 5 seconds of fighting, to avoid detecting the previous moss giant's redbar
Break;
Wait(500);
until not InFight


StatusWithPaint('Killed Moss. Took '+MsToTime(TimeFromMark(KillTime),Time_Formal)+'.' );
stats_Commit; //committing stats (no variebles yet, only time)


LootPileCheck;


HpCheck;
NoobCheck;
checkmomentum();


until False
end;


begin

SetupScript;
Startup;
Main;

end.

eat at 2000.
add actionbar
momentum at n0.1
this maybe good exp for low levels

mr. pali
12-10-2012, 02:14 AM
Finally got my hands on a Saradomin Godsword, and knew just what I would do next....

Update/tinker with this script! I added momentum support, and took out all looting/eating/b2p capabilities (I just commented them out in the main loop). It ended up making the combat a lot snappier.

Anyways, if anyone wants to PM me i'll send them the version of the script I'm currently using.

here's a proggy.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ChaosMossKiller v6.0
* Time Running: 2 Hours, 25 Minutes and 53 Seconds
* STR XP Gained: 90437 (37192)
* STR Level: 73, XP till next: 50094
* B2P: 0 Food: 0
* Not picking up charms.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Shatterhand, your moss giant finding procedure still boggles my mind... I hope to understand it and adapt your methods to an AIO fighter that I will start soon...

For this AIO fighter I plan on making in-combat detection by using the top left menu (crossed swords) and seeing if the player has a target there... should make for efficient fighting... Even though your findDTM method of looking for the red bar is great; it just doesn't allow the script to operate while other players are around.

Anyways, thanks for the great script. Already at 85+ attack, 75+ defense, and working on strength now :).

mr. pali
12-11-2012, 12:31 AM
Someone wanted the script, and I can't figure out how to attach it in a PM, so here it is...

have momentum in your first slot of action bar, and have the action bar open.

keep in mind this script does not eat. have a ring of life equipped (just in case) and you're going to need guthans or a saradomin godsword, or some other method of auto-self healing.

The Divided
12-13-2012, 01:59 PM
I have this problem with the script! Whilest fighting, it keeps clicking the XP counter! Any ideas what might be causing this?

Shatterhand
12-13-2012, 03:19 PM
I have this problem with the script! Whilest fighting, it keeps clicking the XP counter! Any ideas what might be causing this?
Im sure you did not set up the XP counter properly. Read the "How to set up" part on the first post.
Also the script is currently outdated, I take no responsibility for the fixes in the previous posts.

The Divided
12-13-2012, 04:11 PM
Im sure you did not set up the XP counter properly. Read the "How to set up" part on the first post.
Also the script is currently outdated, I take no responsibility for the fixes in the previous posts.

Thanks! this solved it. But i don't see how this script could be outdated since it's working all fine?

Peanuts
12-20-2012, 12:22 AM
spiders under varrok are ok xp

xxgruntxx
12-20-2012, 09:43 PM
Someone wanted the script, and I can't figure out how to attach it in a PM, so here it is...

have momentum in your first slot of action bar, and have the action bar open.

keep in mind this script does not eat. have a ring of life equipped (just in case) and you're going to need guthans or a saradomin godsword, or some other method of auto-self healing.

much appreciated, currently using this one. First fighting script ive been able to get to work with no problem, probably because i didnt need to do any edits myself LoL

sjjp168
05-06-2013, 04:14 PM
???

nitrax
06-06-2013, 06:59 PM
i am not sure what happended to this but for me. it seems like when i am fighting, out of no where it goes and finds bones. then it thinks it needs to look for another moss to kill. so now there is 2 mosses to kill bcus it didnt finish killing off the first one before going to find bones. :P