SRL Archive - Help and Support

Helpzz!


Sir Ducksworthy

2012-09-29 14:45:59

I iz not been ablez to setz the targets image bakz 2 teh Client properlyz can someonez helpzzz me?? :wub:

Bottom of Function GetMonsterNameBitmap():String;
(*
RuneGlider Combat Stuff
=====
By Leetsxc

All of the RuneGlider Operational Functions and Procedures.

.. contents:

Need to make an Exp Expectency Time Frame Calculater based off your Atk, Str lvls
That will predict the likely ness of XP Change per how many seconds
For Quicker Switching
*)

var
x, y, Tries, XP, UpTextBitMap:Integer;
Monster_Point:TPoint;
MonsterLastAttacked:String;
ArrayMonsterXP:TIntegerArray;
UptextArrayAttack, ArrayMonsters:TStringArray;

function WaitFindBitMapToleranceIn(BMP, x, y, x1, y1, x2, y2, Tolerance, TimeBetweenLoops, MaxTime:Integer): Boolean;
var
T: Integer;
begin
Result := False;
T := GetSystemTime + MaxTime;
while (GetSystemTime < T) do
begin
if(FindBitMapToleranceIn(BMP, x, y, x1, y1, x2, y2, Tolerance))then
begin
Result := True;
Exit;
end;
Wait(TimeBetweenLoops);
end;
end;

//by Leetsxc
function FindAllMonstersClose(): Boolean;
var
I, T, X, Y, Tries, RandomTries: Integer;
msPoint,MM:Tpoint;
tempTPA, TempTPA2:TPointArray;
Breakz:Boolean;
begin
Result := False;
While IsMoving() do
Sleep(50);
FindColorsTolerance(TempTPA, 194559, 550, 57, 702, 212, 5);
FindColorsTolerance(TempTPA2, 60671, 550, 57, 702, 212, 5);
TempTPA:=TempTPA+TempTpa2;
FindColorsTolerance(TempTPA2, 55534, 550, 57, 702, 212, 5);
TempTPA:=TempTPA+TempTpa2;
T:=High(TempTPA);
{For i:=0 to T do
TempTPA[i]:=GridCoords16Ex(0, -20, Point(TempTpa[i].x-MMCX, TempTpa[i].x-MMCY));
// TempTPA:=RemoveDistTPointArray(MSCX, MSCY, MSY2/2, TempTPA, True);
T:=High(TempTPA); }
if(T < 1) then
begin
Writeln('No Dots In Distance...');
Exit;
end;
SortTPAFrom(tempTPA, Point(MMCX, MMCY));
MiddleTPA(tempTPA);
for I := 0 to T do
begin
msPoint := MMtoMS(tempTPA[I]);
if(CountColorTolerance(524473, msPoint.x-50, msPoint.y-80, msPoint.x+50, msPoint.y+60, 30)>5)then
begin
Writeln('Found HP BAR');
Exit;
end;
MMouse(msPoint.x, msPoint.y, 0, 0);
if(WaitUpTextMulti(UptextArrayAttack, 100+Random(200)))then
begin
//MonsterLastAttacked:=GetUpText;
Case Random(100) of
0..30: begin
ClickMouse2(False);
WaitOption('ttack', 500+Random(500));
end;
31..100: begin ClickMouse2(True); end;
End;
if(DidRedClick())then
begin
Writeln('FoundUptext, Did Red Click... so we Clicked Atack Monster!');
Result := True;
Breakz:=True;
end;
end else
begin
if(RandomTries<1)then
RandomTries:=RandomRange(1,3);
if(Tries<RandomTries)then
begin
TempTPA2:=GetMiniMapDotsIn('npc', TempTpa[i].x-10, TempTpa[i].y-10, TempTpa[i].x+10, TempTpa[i].y+10);
if(High(TempTPA2)>0)then
begin
Writeln('RandomTries is Working to Re Assess Missed MM Dot');
TempTpa[i]:=TempTpa2[0];
Tries:=Tries+1;
I:=I-1;
end else
RandomTries:=0;
end;
end;
if(Breakz)then
Break;
end;
end;

//by Leetsxc
function FindAllMonsters(): Boolean;
var
I, T, Tries, RandomTries: Integer;
msPoint:Tpoint;
tempTPA, TempTpa2:TPointArray;
Breakz:Boolean;
begin
Result := False;
TempTPA:=GetMMDotsOnMS('npc');
TempTPA:=RemoveDistTPointArray(MMCX, MMCY, 10, TempTPA, false);
MiddleTPA(tempTPA);
SortTPAFrom(tempTPA, Point(MMCX, MMCY));
T:=High(TempTPA);
if(T < 1) then
begin
Writeln('No Dots In Distance...');
Result:=FindAllMonstersClose();
Exit;
end;
for I := 0 to T do
begin
msPoint := MMtoMSEx(0,30,tempTPA[I]);
if(CountColorTolerance(524473, msPoint.x-50, msPoint.y-80, msPoint.x+50, msPoint.y+60, 30)>5)then
begin
Writeln('Found HP BAR');
Exit;
end;
MMouse(msPoint.x, msPoint.y, 0, 0);
if(WaitUpTextMulti(UptextArrayAttack, 100+Random(200)))then
begin
//MonsterLastAttacked:=GetUpText;
Case Random(100) of
0..30: begin
ClickMouse2(False);
WaitOption('ttack', 500+Random(500));
end;
31..100: begin ClickMouse2(True); end;
End;
if(DidRedClick())then
begin
Writeln('FoundUptext, Did Red Click... so we Clicked Atack Monster!');
Result := True;
Breakz:=True;
end else
begin
Breakz:=true;
if(FindAllMonstersClose())then
Result:=true;
end;
end else
begin
if(RandomTries<1)then
RandomTries:=RandomRange(1,3);
if(Tries<RandomTries)then
begin
TempTPA2:=GetMiniMapDotsIn('npc', TempTpa[i].x-10, TempTpa[i].y-10, TempTpa[i].x+10, TempTpa[i].y+10);
if(High(TempTPA2)>0)then
begin
Writeln('RandomTries is Working to Re Assess Missed MM Dot');
TempTpa[i]:=TempTpa2[0];
Tries:=Tries+1;
I:=I-1;
end else
RandomTries:=0;
end;
end;
if(Breakz)then
Break;
end;
end;

{*
This uses the Mini Map to run to near by Npc MM dot's and attack them
I would also like to experiment with gathering SPS Coordinates Around
Last Recordered Monster Kills in a TPointArray N then Just Looking a couple Squarez around it
2 avoid walking out of Areas and stuff
N confining the The Coordinate Dimensions by a large Monsters Dimension
Using Smaller SPS Maps and Looking at the Code that SPS uses to analyze the .pngs
Also the Respawn timers of those Monsters Killed in an TIntArray
Could prioritize where we would be looking first
Also using directions or Excluding certain Zones could work well 2
*}
Procedure RunToMonsters;
var
T, X, Y: Integer;
msPoint:Tpoint;
tempTPA: array of TPoint;
begin
FindColorsSpiralTolerance(x, y, tempTPA, 456703, MMX1, MMY1, MMX2, MMY2, 15);
T:=High(TempTPA);
if(T < 1) then
begin
Writeln('No Dots In MiniMap... 2 Run 2');
Exit;
end;
MiddleTPA(tempTPA);
// SortTPAFrom(tempTPA, SPS_PosToMM(Monster_Point));
msPoint:=MMtoMS(TempTPA[0]);
if(InRange(msPoint.x, 0, 800) and InRange(msPoint.x, 0, 800))then
MMouse(MsPoint.x, MsPoint.y, 4, 4)
else
MMouse(tempTPA[0].x, tempTPA[0].y, 4, 4);
Sleep(Random(150));
ClickMouse2(True);
end;

Procedure WriteOpponent(Action:String); //Writing Actions for the Main Loop in RuneGlider to Detect and Commence then Delete N follow up
begin
WriteINI('Character Data', 'Current_Opponents:', Action, 'C:\Simba\Includes\RuneGlider\CharacterData\' + Players[0].Name + '.net');
end;

{*
This Procedure is used to Read Which Monster you are currently Fighting, Wait Until you have gained the Total Xp for killinh the monster or
Your Xp has not changed within the Average Expectency Time based on your Combat Levels
We can Time the Expectency times at all levels if it is 2 hard to calculate but it should be mainly based on attack level n the monsters defence..
*}
Procedure XPMonitor;
var
ArrayPos, Store, Time, Total, Increase, TimeExpectency:Integer;
Match:Boolean;
begin
MonsterLastAttacked:=Between('ttack ', ' (level', MonsterLastAttacked);
Store:=High(ArrayMonsters);
Increase:=XP
For ArrayPos:=0 to Store do
if(MonsterLastAttacked=ArrayMonsters[ArrayPos])then
begin
Match:=True;
Break;
end;
if(Match=False)then
begin
ArrayPos:=0;
MonsterLastAttacked:=ArrayMonsters[0];
end;
//Maybe use a Global var that saves when Clicking or Something for Cows n Cow Calf Xp Difference
Writeln('Fighting a: ' + MonsterLastAttacked);
Writeln('XP per kill: ' + inttostr(ArrayMonsterXP[ArrayPos]));
TimeExpectency:=3000;
While TimeExpectency>0 do
begin
Time:=GetSystemTime();
Sleep(50);
Total:=GetXPBarTotal();
if((XP+ArrayMonsterXP[ArrayPos]-1)>Total)then
TimeExpectency:=TimeExpectency-(GetSystemTime()-Time) //Minus MS that Operation Took For an Accurate Measurement
else
Break;
if(Total>Increase)then
begin
TimeExpectency:=3000;
Writeln('Xp Increased! by ' + inttostr(Total-Increase));
Increase:=Total;
end;
//Writeln('Time Expectency Xp Count n Compare Speed MS: ' + Inttostr(GetSystemTime()-Time));
//Writeln('Waiting for XP to be ABOVE!: ' + inttostr(XP+ArrayMonsterXP[ArrayPos]-1));
end;
Writeln('Fight Over!.. Attacking Next Monster');
Xp:=Total;
end;

//Leetz Custom Func to Grab the First Letter of a string To make Database Searching 25x Quicker
Function FirstLetterz(StringToAnalyze:String):String;
var
i:Integer;
LetterArray, Store:TStringArray;
Text:String;
begin
LetterArray:=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
Text:=StringToAnalyze;
Text:=ReplaceRegExpr(' ', Text, ' ' + ',',True);
For i:=0 to 25 do //26 Letters in the Alphabet no need to Count the Length with Simba.. ;) Saves Ms's + 1 less int
begin
Text:=ReplaceRegExpr(LetterArray[i], Text, LetterArray[i] + ',',True);
Text:=ReplaceRegExpr(lowercase(LetterArray[i]), Text, lowercase(LetterArray[i]) + ',',True);
end;
Store:=Explode(',', Text);
WriteLn(Store);
Result:=Capitalize(Store[0]);
end;

//Leetsxcs baby <3
Procedure FindMonstersLocation(Name:String);
var
TreeCount, SymbolCount, i:Integer;
FirstLetter:String;
StorePoint:Tpoint;
TPA, TempTPA:TpointArray;
ColorClusters:T2DPointArray;
Percentages:TExtendedArray;
Score, MatchPercentData, TempITA, Store:TIntegerArray;
CombinedColors, LocationData:Array of Array of TIntegerArray; //T3DIntegerArray
Colors:T2DIntegerArray;
LocationColorStrings, NameDataLocations, SPS_MAPS:TStringArray;
LocationStrings:Array of Array of TStringArray; //T3DStringArray
begin
SetLength(Store, 9);
FirstLetter:=FirstLetterz(Name);
NameDataLocations:=Explode(',', ReadINI(Name, 'Locations:', 'C:\Simba\Includes\RuneGlider\MonsterData\MonsterDatabase_' + FirstLetter +'.net'));
Store[0]:=High(NameDataLocations);
SetLength(CombinedColors, Store[0]+1);
SetLength(LocationStrings, Store[0]+1);
SetLength(LocationData, Store[0]+1);
SetLength(MatchPercentData, Store[0]+1);

For Store[1]:=0 to Store[0] do
begin
SetLength(LocationStrings[Store[1]], 4);
SetLength(LocationData[Store[1]], 4);
end;

SetLength(LocationStrings[0][0], 10);
For Store[1]:=0 to Store[0] do
LocationStrings[Store[1]][1]:=Explode(',', ReadINI(NameDataLocations[Store[1]], 'BitMaps:', 'C:\Simba\Includes\RuneGlider\Npc Location Data\NpcLocationData_' + FirstLetter +'.net'));

Writeln(LocationStrings[0][1][0]);
Writeln(LocationStrings[1]);

//BitMap DATA
For Store[1]:=0 to Store[0] do
begin
Store[2]:=High(LocationStrings[Store[1]][1]);
SetLength(CombinedColors[Store[1]], Store[2]+1);
SetLength(LocationData[Store[1]][1], Store[2]+1);
SetLength(LocationData[Store[1]][2], Store[2]+1);
SetLength(LocationData[Store[1]][3], Store[2]+1);
For Store[3]:=0 to Store[2] do
begin
Writeln('Loading BitMap Data...');
LocationData[Store[1]][1][Store[3]]:=StrToInt(ReadIni(LocationStrings[Store[1]][1][Store[3]], 'Pixels:', 'C:\Simba\Includes\RuneGlider\Map\MapItemDatabase\MapItemDatabase_' +
FirstLetterz(LocationStrings[Store[1]][1][Store[3]]) + '.net'));
LocationData[Store[1]][2][Store[3]]:=StrToInt(ReadIni(LocationStrings[Store[1]][1][Store[3]], 'BitMapTolerance:', 'C:\Simba\Includes\RuneGlider\Map\MapItemDatabase\MapItemDatabase_' +
FirstLetterz(LocationStrings[Store[1]][1][Store[3]]) + '.net'));
LocationColorStrings:=Explode(',', ReadIni(LocationStrings[Store[1]][1][Store[3]], 'Colors:', 'C:\Simba\Includes\RuneGlider\Map\MapItemDatabase\MapItemDatabase_' +
FirstLetterz(LocationStrings[Store[1]][1][Store[3]]) + '.net'));
Store[5]:=High(LocationColorStrings);
SetLength(CombinedColors[Store[1]][Store[3]], High(LocationColorStrings)+1);
For Store[4]:=0 to Store[5] do
CombinedColors[Store[1]][Store[3]][Store[4]]:=CombinedColors[Store[1]][Store[3]][Store[4]]+Strtoint(LocationColorStrings[Store[4]]);
end;
end;

SetLength(Percentages, 2);

Writeln('Successfully Loaded Map Data.. Comparing now..');
Store[0]:=High(LocationData);
For Store[1]:=0 to Store[0] do
begin
Store[3]:=High(LocationData[Store[1]][1]);
For Store[2]:=0 to Store[3] do
begin
Writeln('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$');
Writeln('Comparing Map to: ' + LocationStrings[Store[1]][1][Store[2]]);
Store[5]:=High(CombinedColors[Store[1]][Store[2]]);
Writeln(Store[5]);
SetLength(TPA, 0);
For Store[6]:=0 to Store[5] do
if(FindColorsTolerance(TempTPA, CombinedColors[Store[1]][Store[2]][Store[6]], MMX1, MMY1, MMX2, MMY2, LocationData[Store[1]][1][Store[2]]))then
TPA:=TPA+TempTPA;

//Minus the Tolerance as a percentage from the Percentage accepted
TPA:=RemoveDistTPointArray(MMCX, MMCY, 65, TPA, True);
ColorClusters:=SplitTPA(TPA, 1);
SortATPASize(ColorClusters, True);
Store[6]:=High(ColorClusters[0]);
Store[7]:=LocationData[Store[1]][1][Store[2]];
Writeln('Total Pixels Detected In Largest Cluster of Bitmap Colors on Minimap:' + Inttostr(Store[6]));
Writeln('Total Pixel Count of Bitmap: '+ Inttostr(Store[7]));
Percentages[0]:=(Store[7]/100.00)*20;
Percentages[0]:=Store[7]-Percentages[0];
Writeln('80% of Non Black Bitmap Pixels =: ' + Floattostr(Percentages[0]));
Percentages[1]:=(Store[6]/100.00)*20;
Percentages[1]:=Store[6]+Percentages[1];
Writeln('Non Black Pixels Detected with a Tolerance of 20% =: ' + Floattostr(Percentages[1]));
if(Store[6]>=Store[7])then
begin
Writeln('The Item Matches with over 80% Accuracy!');
MatchPercentData[Store[1]]:=MatchPercentData[Store[1]]+1;
end;
//SMART_DrawDotsEx(True, TPA, ClBlue);
end;
end;


//Short Algorithms to narrow down the Highest result
Store[7]:=0;
Store[5]:=High(NameDataLocations);
Store[2]:=Store[5];
Setlength(Score, Store[2]+1);
For Store[1]:=0 to Store[2] do
For Store[4]:=0 to Store[5] do
if(MatchPercentData[Store[1]]>MatchPercentData[Store[4]]) then
Score[Store[1]]:=Score[Store[1]]+1;
ClearSameIntegers(Score);
For Store[1]:=0 to Store[2] do
begin
Store[8]:=0;
For Store[4]:=0 to Store[5] do
if(Score[Store[1]]>Score[Store[4]]) then
begin
Store[8]:=Store[8]+1;
if(Store[8]=Store[5]-1)then // 9/10s
Store[7]:=Store[1]; //Location
end;
end;
Writeln('Map Analysis Suggests the Most Likely Place we are Located at is: '+ NameDataLocations[Store[7]]);
// TerminateScript();

//Loading SPS Maps...
SPS_MAPS:=Explode(',', ReadINI(NameDataLocations[Store[7]], 'SPS_MAPS:', 'C:\Simba\Includes\RuneGlider\Npc Location Data\NpcLocationData_' + FirstLetter +'.net'));

end;

Procedure GetMonsterNameData(Name:String);
Var
I,Store:Integer;
begin
ArrayMonsters:=Explode(',', ReadINI('Character Data', 'Current_Opponents:', 'C:\Simba\Includes\RuneGlider\CharacterData\' + Players[0].Name + '.net'));
Writeln(ArrayMonsters);
Store:=High(ArrayMonsters);
SetLength(UptextArrayAttack, Store+1);
SetLength(ArrayMonsterXP, Store+1);
if(Store>1)then
begin
For i:=0 to Store do
begin
UptextArrayAttack[i]:='ck ' + ArrayMonsters[i];
ArrayMonsterXP[i]:=strtoint(ReadINI(ArrayMonsters[i], 'XPRate:', 'C:\Simba\Includes\RuneGlider\MonsterData\MonsterDatabase_' + FirstLetterz(ArrayMonsters[i]) +'.net'));
end;
end else
begin
UptextArrayAttack[0]:='ck ' + ArrayMonsters[0];
ArrayMonsterXP[0]:=strtoint(ReadINI(ArrayMonsters[0], 'XPRate:', 'C:\Simba\Includes\RuneGlider\MonsterData\MonsterDatabase_' + FirstLetterz(ArrayMonsters[0]) +'.net'));
end;
//Writeln(UptextArrayAttack);
FindMonstersLocation(Name);
Monster_Point:=SPS_GetMyPos();
end;

{ Searches through the TPA of MM Icons 10 times to detect a Yellow Uptext Name Color
Freezes Client
Then Makes a Bitmap of the Uptext Area
SetsClient to the Bitmap
Grabs the Yellow monster Name from the Bitmap
Searches the DataBase For any Matches So it can Find Its Location
If No matches are found it will Sound an Alarm and Log Out

By Leetsxc
}
Function GetMonsterNameBitmap():String;
var
tempTPA, tempTPA2,Pixels:TPointArray;
msPoint:Tpoint;
Data:TIntegerArray;
Text:String;
begin
SetLength(Data,18);
SetLength(TempTPA, 20);
For Data[6]:=0 to 10 do
begin
For Data[5]:=0 to 20 do
begin
FindColorsTolerance(TempTPA2, 65535, MMX1, MMY1, MMX2, MMY2, 4);
TempTPA:=TempTpa2;
FindColorsTolerance(TempTPA2, 917503, MMX1, MMY1, MMX2, MMY2, 4);
TempTPA:=TempTPA+TempTpa2;
FindColorsTolerance(TempTPA2, 54747, MMX1, MMY1, MMX2, MMY2, 4);
TempTPA:=TempTPA+TempTpa2;
SortTPAFrom(tempTPA, Point(MMCX, MMCY));
RaasTPA(TempTPA, 5);
Data[8]:=High(TempTPA);
if(Data[8] > 0) then
begin
writeln(Data[8]);
// sleep(10000);
Data[7]:=1;
Break;
end;
end;

if(Data[7]=1)then
begin
Writeln('Found Dots');
For Data[7]:=0 to Data[8] do
begin
msPoint := MMtoMSEx(0,20,tempTPA[Data[7]]);
Writeln(MsPoint);
if((MsPoint.x>MSX1) and (MsPoint.x<MSX2) and (MsPoint.y<MSY2) and (MsPoint.y>MSY1))then
begin
MMouse(msPoint.x, MsPoint.y, 0, 0);
// sleep(10000);
if(WaitFindColor(Data[3], Data[4], 331794, MSX1, MSY1, MSX1+200, MSY1+30, 25, 150+Random(200)))then
begin
try
CopyClientToBitmap(Data[0],MSX1, MSY1, MSX1+200, MSY1+80);
except
writeln('Access violation!: trying to Copy Client Image to Bitmap... restarting loop');
exit;
end;
SetTargetBitmap(Data[0]);
ClearDebugImg;
DrawBitmapDebugImg(Data[0]);
//sleep(10000);
//GetClientDimensions(Data[1],Data[2]);
if(FindColorTolerance(Data[3], Data[4], 331794, MSX1, MSY1, MSX1+200, MSY1+30, 20))then
begin
Writeln('Found a Yellow Name Color In bitmap so it should be a Monster Name!');
// x, y, minSpacing, maxSpacing, 4, textcolor, tolerance, textlength, Chars
Text:=Between('Attack ', ' (l', rs_GetUpText());
Writeln('Name Detected: ' + Text);
Writeln('Searching Database..');
if(not(ReadINI(Text, 'XPRate:', 'C:\Simba\Includes\RuneGlider\MonsterData\MonsterDatabase_' + FirstLetterz(Text) +'.net')=''))then
begin
Data[6]:=10;
Writeln('Monster Found in DataBase!.. Checking Location..');
For Data[11]:=Data[11]+1 to 100 do
if(CountColorTolerance(382680, Data[11], 0, Data[11], 30, 20)>3)then
begin
Writeln('Found Yellow Part of Bitmap + X');
Writeln('Left side = ' + inttostr(Data[11]));
Break;
end;
Data[12]:=200;
For Data[12]:=Data[12]-1 downto 50 do
if(CountColorTolerance(382680, Data[12], 0, Data[12], 30, 20)>3)then
begin
Writeln('Found Yellow Part of Bitmap -X');
Writeln('Right side = ' + inttostr(Data[12]));
// Data[15]:=Data[12];
Break;
end;
Try Data[13]:=BitmapFromClient(Data[11]-3, 10, Data[12]+3, 22); Except End;
Data[16]:=CopyBitmap(Data[13]);
SetTargetBitmap(Data[13]);
GetClientDimensions(Data[11], Data[12]);
For Data[14]:=1 to Data[12]-1 do
For Data[15]:=1 to Data[11]-1 do
if(not(FindColorTolerance(Data[3], Data[4], 382680, Data[15], Data[14], Data[15], Data[14], 20)))then
FastSetPixel(Data[16], Data[15], Data[14], 131072);
SaveBitmap(Data[16], 'C:/Simba/' + Text +' Uptext.bmp');
UpTextBitMap:=CopyBitmap(Data[16]);
ClearDebugImg;
Data[17]:=1;
Try DrawBitmapDebugImg(Data[16]); except end;
try FreeBitMap(Data[13]); except end;
try FreeBitMap(Data[16]); except end;
try FreeTarget(Data[16]); except end;
try FreeTarget(Data[13]); except end;
try FreeTarget(Data[0]); except end;
try FreeTarget(Data[1]); except end;
try FreeBitmap(Data[0]); except end;
try FreeBitmap(Data[0]); except end;
Data[7]:=Data[8];
end else
Writeln('No Database Matches Lets keep Trying..');
end;
ActivateClient;
ImageResetClientArea;
end else
Writeln('No NPC Detected');
end;
end;
end;
Data[7]:=0;
if(Data[17]=1)then
begin
Result:=Text;
Break;
end else
if(Data[6]>9)then
begin
Writeln('Tried 10 Times to Find NPC/Monster in DataBase and No match..');
//if(SoundAlarms)then SoundAlarm;
//Logout;
Data[6]:=0;
end;
end;
end;

//Reads Current Monster Data needed for Global Variables Needed for Combat Loop to function
Procedure GetMonsterData;
Var
I,Store:Integer;
begin
ArrayMonsters:=Explode(',', ReadINI('Character Data', 'Current_Opponents:', 'C:\Simba\Includes\RuneGlider\CharacterData\' + Players[0].Name + '.net'));
Writeln(ArrayMonsters);
Store:=High(ArrayMonsters);
SetLength(UptextArrayAttack, Store+1);
SetLength(ArrayMonsterXP, Store+1);
if(Store>1)then
begin
For i:=0 to Store do
begin
UptextArrayAttack[i]:='ck ' + ArrayMonsters[i];
ArrayMonsterXP[i]:=strtoint(ReadINI(ArrayMonsters[i], 'XPRate:', 'C:\Simba\Includes\RuneGlider\MonsterData\MonsterDatabase_' + FirstLetterz(ArrayMonsters[i]) +'.net'));
end;
end else
begin
UptextArrayAttack[0]:='ck ' + ArrayMonsters[0];
ArrayMonsterXP[0]:=strtoint(ReadINI(ArrayMonsters[0], 'XPRate:', 'C:\Simba\Includes\RuneGlider\MonsterData\MonsterDatabase_' + FirstLetterz(ArrayMonsters[0]) +'.net'));
end;
Writeln(UptextArrayAttack);
Monster_Point:=SPS_GetMyPos();
end;

Procedure CombatLoop;
Var
I,II:Integer;
begin
Writeln('Combat Loop..');
For II:=0 to 10 do
begin
if(FindAllMonsters())then
begin
//Writeln('We are Currently Running to a Near By Monster... Drawing Line On Map Based on Click Area and Angular Movement of Our Character Dot and for Other Players Near Dot');
For I:=0 to 50 do
begin Sleep(100); {Writeln('Not In Combat');}
if((SRL_InFight()=True) or (XP<GetXPBarTotal()))then
Break;
while FlagPresent do
sleep(50);
end;
if(I<50)then
begin
Writeln('InCombat');
XPMonitor;
end;
//MonitorDots;
end else
if(IsMoving=False)then //Scan for Monsters While Running for quick attacks and directions changes
begin
Tries:=Tries+1;
if(Tries>Randomrange(5, 10))then
begin
Writeln('Running to Nearest NPC Dot 2 Middle of SPS Point area');
RunToMonsters();
Tries:=0;
end;
end;
end;
end;

Procedure Initiliaze;
Var
Text:String;
begin
Text:=GetMonsterNameBitmap();
if(not(Text=''))then
GetMonsterNameData(Text)
else begin
writeln('Failed to Identify any Npcs in the area.');
Initiliaze;
end;
end;

Sir Ducksworthy

2012-10-06 16:13:46

Has anyone got any suggestions? this is really getting to me.

Brandon

2012-10-06 19:13:33

From: Sir Ducksworthy
Has anyone got any suggestions? this is really getting to me.



If you asked the question properly, I'm sure someone would read it. Also why is the format of your code so bad? :S

Sir Ducksworthy

2012-10-06 23:52:59

Grr.. :p I'm very sorry, damn where is the love?
Okay, I need help with getting the image target to set back to the client area after setting it to a bitmap, please.
  
ActivateClient;
ImageResetClientArea;
^ Setimagetargetarray etc have not worked either.
Cheers ;)
P.S: My code format is so bad because I coded it like that and I'm obviously not that Leetsxc in that area you know.., I do try tho.

Brandon

2012-10-07 01:02:57


SomeInt = GetTarget;
SetTargetBitmap(........);
//Do Stuff with the new target.
SetTarget(SomeInt); //Set it back to the old target.
FreeBitmap(.....);



function FindAndSetTarget(TitlePrefix: String; SetAsTarget: Boolean): Boolean;
var
T: TSysProcArr;
I: Integer;
begin
T:= GetProcesses();
for I := 0 to high(T) do
if StartsWith(TitlePrefix, T[i].Title) then
begin
Result := True;
if SetAsTarget then
begin
SetTarget(T[i]);
ActivateClient;
end;
end;
end;


http://docs.villavu.com/simba/scriptref/window.html

Home

2012-10-07 01:59:51

Look into Flag function for example

Sir Ducksworthy

2012-10-10 01:17:50

Tried that ages ago, didn't work. Thx for trying to help with it tho man appreciated 4 sure <3 working fine in java atm tho, jus want 2 get a f2p ver going