SRL Archive - S.M.A.R.T.

Error: Exception: Access violation at line 143


Stray Bullets

2011-12-15 20:58:02

Following that last Runescape update, something seems to have broken on my end. Kind of strange, since I didn't touch anything, but right now SMART refuses to load.

Trying to run Pest Controller. When I first try to run the script, it just sits there for a solid 10 minutes doing nothing. When I attempt to stop the script and run it again, a SMART tab opens up, and I'm greeted with this error.

Error: Exception: Access violation at line 143

Line 143 looks like this -

SmartSetup('http://'+prefix+'.runescape.com/', ',f5', 765, 503, 's');  

I tried the various fixes posted on the forums here, but no luck. Any suggestions?

Kyle Undefined

2011-12-15 21:00:29

Take that line out, all you need is {DEFINE SMART} at the top of the script. It should above the SRL include.

Stray Bullets

2011-12-15 21:14:11

From: Camo Developer
Take that line out, all you need is {DEFINE SMART} at the top of the script. It should above the SRL include.


Still getting the Error: Exception: Access violation at line 143

If it helps any, here's what SMART looks like

{$DEFINE SRL_SMART}
{$DEFINE SMART}
{$ifdef Simba}
{.loadlib libsmart}
{$endif}

{$ifdef Simba}
function IsKeyDown(C:Byte): Boolean;
begin
Result := SmartIsKeyDown(C);
end;
{$else}
function IsKeyDown(C:Char): Boolean;
begin
Result := SmartIsKeyDown(ord(c));
end;
{$endif}

procedure MoveMouse(x, y: Integer);
begin
SmartMoveMouse(x, y);
end;

{$ifdef Simba}
procedure HoldMouse(x, y: Integer; button : integer);
begin
if button = mouse_left then
SmartHoldMousePlus(x,y,1)
else if button = mouse_middle then
SmartHoldMousePlus(x,y,2)
else if button = mouse_right then
SmartHoldMousePlus(x,y,3)
else
raiseexception(ercustomerror,'Unknown mouse button in SmartHoldMousePlus');
end;

procedure ReleaseMouse(x, y: Integer; button : integer);
begin
if button = mouse_left then
SmartReleaseMousePlus(x,y,1)
else if button = mouse_middle then
SmartReleaseMousePlus(x,y,2)
else if button = mouse_right then
SmartReleaseMousePlus(x,y,3)
else
raiseexception(ercustomerror,'Unknown mouse button in SmartReleaseMousePlus');
end;
{$else}
procedure HoldMouse(x, y: Integer; left: Boolean);
begin
SmartHoldMouse(x, y, left);
end;

procedure ReleaseMouse(x, y: Integer; left: Boolean);
begin
SmartReleaseMouse(x, y, left);
end;
{$endif}

procedure KeyUp(key: Byte);
begin
If Key = 13 Then
Key := 10;
SmartReleaseKey(key);
end;

procedure KeyDown(key: Byte);
begin
If Key = 13 Then
Key := 10;
SmartHoldKey(key);
end;

procedure SendKeys(S: String);
begin
SmartSendKeys(S);
end;

procedure GetMousePos(var x, y: Integer);
begin
SmartGetMousePos(x, y);
end;

function GetColor(x, y: Integer): Integer;
begin
result:= SmartGetColor(x, y);
end;

procedure SmartSetTarget;
{$ifdef Simba}
begin
SetTargetArray(SmartImageArray, 765,503);
end;
{$else}
var
Smart_Bitmap: Integer;
begin
Smart_Bitmap:= BitmapFromString(765,503,'');
GetBitmapCanvas(Smart_Bitmap).Handle:= SmartGetDC;
SetTargetBitmap(Smart_Bitmap);
FreeBitmap(Smart_Bitmap);
end;
{$endif}

function FindWindow(Title: String): Boolean;
begin
result:= true;
end;

procedure ActivateClient;
begin
end;

function FindWindowBySize(Width, Height: Integer): Boolean;
begin
result:= true;
end;

{procedure SmartSaveSettings(v: TVariantArray);
var
i: Integer;
ts: TStringArray;
begin
ts := ['server', 'members', 'signed', 'sd', 'DC', IncludePath + 'SRL/SRL/misc/smartINI.ini'];
for i := 0 to 4 do
WriteINI('SMART', ts[i], v[i], ts[5]);
end; }

procedure SmartSetupEx(Server: integer; members, signed, superdetail: boolean);
var
prefix: string;
begin
{$IFDEF SIMBA}
prefix := ReadINI('World' + IntToStr(Server), 'Prefix', IncludePath + 'SRL/SRL/misc/worlds.ini');
{$ELSE}
prefix := ReadINI('World' + IntToStr(Server), 'Prefix', {$IFDEF SCAR325_UP} IncludesPath {$ELSE} AppPath + 'Includes\' {$ENDIF} + 'SRL\SRL\misc\worlds.ini');
{$ENDIF}
if(prefix = '')then
begin
writeln('Invalid world number or corrupted world list. Please review your settings');
TerminateScript;
end;

//SmartSaveSettings([Server, Members, Signed, SuperDetail, SmartGetDC]);
end;

{function SmartLastSettings: TStringArray;
var
i: Integer;
ts: TStringArray;
begin
ts := ['server', 'members', 'signed', 'sd', 'DC', IncludePath + 'SRL/SRL/Misc/smartINI.ini'];
SetLength(Result, 5);
for i := 0 to 4 do
Result[i] := ReadINI('SMART', ts[i], ts[5]);
end; }

{$ifndef Simba}
Procedure SaveScreenshot(s : string);
var
TempBMP : integer;
TempS : String;
begin;
Temps := s;
While FileExists(Temps) do
begin;
Temps := ExtractFilePath(s) + Copy(ExtractFileName(Temps),1,LastPos('.',ExtractFileName(Temps))-1) + '2' + ExtractFileExt(s);
Writeln(Temps);
end;
TempBMP := BitmapFromString(765,503,'');
Try
CopyClientToBitmap(TempBMP,0,0,765,503);
SaveBitmap(TempBMP, Temps);
Except
end;
FreeBitmap(TempBMP);
end;
{$endif}


and the script

program Pest_Controller;
{$i srl/srl/misc/Smart.scar}
{DEFINE SMART}
{.include SRl\SRL.scar}
{$i SRL\SRL\Misc\Stats.simba}


var //Don't touch!
Boat: Integer; //Don't touch!
QuickPray: Boolean; //Don't touch!
SRLStats_Username, SRLStats_Password: String; //Don't touch!
SpendPointsOn, SelectBoots: TStringArray; //Don't touch!


//Descriotion:
//This is a free pest control script by weequ.
//You will need a program called Simba to bot with this script.
//You can download Simba from this site: [url]http://wizzup.org/simba/[/url]
//You will also need SRL Include.
//To get SRL you must enable SRL extension in Simba.
//You can do that in the View -> Extensions menu.
//Now you should be ready to bot.
//Place your runescape character next to a boat @ pest control.
//Set your graphics to lowest details and max brightness.
//Fill the setup below.
//Press the green arrow in Simba (Ctrl+Alt+R)
//Happy botting.


procedure Setup;
begin

//========SETUP==========\\

Players[0].Name := ''; //Player username.
Players[0].Pass := ''; //Player password.

Boat := 1; // Which boat to use?
// 1 = 40+ (Novice)
// 2 = 70+ (Intermediate)
// 3 = 100+ (Veteran)

QuickPray := False; // Use QuickPrayers?
// True = yes
// False = no

SpendPointsOn := ['defence']; // Add as many as you want. Will do last one forever.
//strength/attack/defence/constitution
//magic/ranged/prayer
//top/gloves/robes
//melee helm/ranger helm/mage helm
//mace, deflector, seal

SelectBoots := ['battlemage', 'trickster', 'vanguard']; //What hybrid boots you want to choose? Will do last one forever.
//battlemage, trickster, vanguard

SRLStats_Username := ''; // Your SRL Stats Username (Optional) Register here: [url]http://stats.villavu.com/[/url]
SRLStats_Password := ''; // Your SRL Stats Password (Optional) Register here: [url]http://stats.villavu.com/[/url]

//======END OF SETUP=====\\

end;

// Do not touch below unless you know what you are doing

type
ColorInfo = record
Color : Integer;
Tol : Integer;
MinCount : Integer;
Hue : Extended;
Sat : Extended;
end;

Monster = record
Name : String;
Combat : Integer;
Colors : Array of ColorInfo;//All must be found
end;
Activity = record
Action : String;
Time : Integer;
end;

var
DeathsA, WinsA, LosesA, CurrentPointsA, AntiBansA, TalkedA, CombatLevel: Integer;
WaterColorB, DarkLadderColorB, LightLadderColorB, CenterColorB: Integer;
Ex, BootsIndex, NextBreak: Integer;
Walked, LastestVersion: Boolean;
RecentActivity: Array [0..2] of Activity;
Monsters: Array of Monster;


const
VERSION_NUMBER = 9.0;
WORLD = 53;
MIN_NEXTBREAK = 3600000;//1 hour
MAX_NEXTBREAK = 14400000;//4 hour
MIN_BREAKTIME = 180000;//3 min
MAX_BREAKTIME = 900000;//15min

WATERCOLORA = 10063238;
DARKLADDERCOLORA = 1194057;
LIGHTLADDERCOLORA = 1785432;
CENTERCOLORA = 2714499;
DARKWATERCOLORA = 8287087;




function FindDarkLadderColor: Integer;
var
P: TPointArray;
I, II, CurrentColor: Integer;
begin
FindColorsTolerance(P, DARKLADDERCOLORA, MMX1, MMY1, MMX2, MMY2, 50);
for I := 0 to High(P) do
begin
CurrentColor := GetColor(P[I].X, P[I].Y);
if ((GetColor(P[I].X+1, P[I].Y) = currentColor+(LIGHTLADDERCOLORA-DARKLADDERCOLORA)) or (GetColor(P[I].X, P[I].Y+1) = CurrentColor+(LIGHTLADDERCOLORA-DARKLADDERCOLORA))) then Inc(II);
if II > 4 then
begin
Result := CurrentColor;
Exit;
end;
end;
end;

{To Come Later
function FindRedMMColor: Integer;
var
I: Integer;
TPA: TPointArray;
Colors: TIntegerArray;
begin
FindColorsSpiralTolerance(MMCX, MMCY, TPA, 263409, MMX1, MMY1, MMX2, MMY2, 16);
Colors := GetColors(TPA);
ClearSameIntegers(Colors);
for I := 0 to High(Colors) do
begin
end;
end;}


function Loading: Boolean;
begin
result := (GetColor(140, 33) = 13092807);
end;

function InGame: Boolean;
begin
result := (getColor(370, 74) = 16711935) and (getColor(404, 70) = 16737894);
end;

function ClanScreen: Boolean;
var
X, Y: Integer;
begin
Result := (FindColor(X, Y, 3226804, 460, 30, 461, 31) or FindColor(X, Y, 3292596, 460, 30, 461, 31));
end;



//Uses the Box–Muller transform method to generate standard normally distributed random number.
function GaussianValue(MaxValue: Extended; Positive: Boolean): Extended;
var
r1, r2: extended;
begin
repeat
r1 := (Random(2147483645) + 1) / 2147483646.0;
r2 := Random(2147483646) / 2147483647.0;
case Positive of
True: Result := Abs(sqrt(-2 * ln(r1)) * sin(2 * PI * r2));
False: Result := sqrt(-2 * ln(r1)) * sin(2 * PI * r2);
end;
until(Abs(result) <= MaxValue);
end;

//Determines the gaussian value to a scale 0 - MaxValue or (-MaxValue) - (MaxValue)
//if Positive is set to false
function Gaussian(MaxValue, MaxGaussian: Extended; Positive: Boolean): Extended;
begin
Result := MaxValue*(GaussianValue(MaxGaussian, Positive)/MaxGaussian);
end;


procedure GMMouse(x, y, rx, ry: Integer);
begin
MMouse(x+Round(rx/2.0+Gaussian(rx/2.0, 1.7, false)), y+Round(ry/2.0+Gaussian(ry/2.0, 1.7, false)), 0, 0);
end;

procedure GMouse(x, y, rx, ry: Integer; left: Boolean);
var
StartX, StartY, TargetX, TargetY, Button: Integer;
DeltaX, DeltaY: Integer;
Neliojuuri, K: Extended;
begin
GetMousePos(StartX, StartY);
GMMouse(x, y, rx, ry);
GetMousePos(TargetX, TargetY);
if left then Button := MOUSE_LEFT
else Button := MOUSE_RIGHT;
HoldMouse(TargetX, TargetY, Button);
Wait(25+Round(Gaussian(70, 2.3, True)));
if (Random(15) = 0) then
begin
DeltaX := TargetX-StartX;
DeltaY := TargetY-StartY;
Neliojuuri := Sqrt(DeltaY*DeltaY+DeltaX*DeltaX);
if (Neliojuuri = 0) then MoveMouse(TargetX-1+Random(3), TargetY-1+Random(3))
else begin
K := 1.5/Neliojuuri;
MoveMouse(TargetX+Round((K*DeltaX)), TargetY+Round((K*DeltaY)));
end;
end;
Wait(25+Round(Gaussian(70, 2.3, True)));
ReleaseMouse(TargetX, TargetY, Button);
end;



function CloseClanScreen: Boolean;
begin
if not ClanScreen then Exit;
GMouse(475, 29, 7, 7, True);
MakeCompass(rs_GetCompassAngleDegrees-95+Random(2)*180+Random(10));
Result := True;
end;


function InBoat: Boolean;
begin
result := (getColor(19, 30) = 13421772) and (getColor(19, 51) = 3265113);
end;

procedure Proggy(Situation: string);
var
Texts: array of string;
I: Integer;
begin
RecentActivity[2] := RecentActivity[1];
RecentActivity[1] := RecentActivity[0];
RecentActivity[0].Action := Situation;
RecentActivity[0].Time := GetSystemTime;
SetDebugColors(1054841, 16777215);
Texts := [
'Recent Activity:',
'-'+RecentActivity[2].Action+' ('+IntToStr((GetSystemTime-RecentActivity[2].Time)/1000)+' s ago)',
'-'+RecentActivity[1].Action+' ('+IntToStr((GetSystemTime-RecentActivity[1].Time)/1000)+' s ago)',
'-'+RecentActivity[0].Action+' ('+IntToStr((GetSystemTime-RecentActivity[0].Time)/1000)+' s ago)',
'|---------------------------------------------',
'|Pest Controller Progress Report:',
'|---------------------------------------------',
'|Worked for : ' + TimeRunning,
'|Wins: ' + IntToStr(WinsA),
'|Loses: ' + IntToStr(LosesA),
'|Deaths: ' + IntToStr(DeathsA),
'|Antibans: ' + IntToStr(AntiBansA),
'|---------------------------------------------'];
ClearDebug;
for I := 0 to High(Texts) do
begin
WriteLn(Texts[I]);
end;
end;



procedure InBoatAntiBan;
var
x, y: Integer;
P: TPoint;
begin
If(not LoggedIn)then Exit;
Inc(AntiBansA);
MouseSpeed := 12 + Random(5);
Case Random(13) of
0: GMMouse(Random(MIX2), Random(MIY2), 10, 10);
1:
if Random(4) = 1 then HoverSkill('random', False)
else Dec(AntiBansA);
2: PickUpMouse;
3: GameTab(RandomRange(tab_Combat, tab_Notes));
4: SleepAndMoveMouse(400+Random(Random(4000)));
5: IdleTime(100+random(700), 100+Random(100), 0.2+RandomE/2);
6: DoEmote(1+random(19));
7:
begin
GMouse(Random(MIX2), Random(MIY2), 0, 0, False);
Sleep(200+Random(200));
if not ChooseOption('xamine') then
ChooseOption('ancel');
end;
8: MakeCompass(IntToStr(Random(360)));
9:
begin
if Random(20) = 1 then
begin
Inc(TalkedA);
case Random(11) of
0: Typesend('cm0n');
1: Typesend('lol');
2: Typesend('1 more');
3: Typesend('plz');
4: Typesend('hurry');
5: Typesend('all on portals');
6: Typesend('someone stay in center');
7: Typesend('im getting full void');
8: Typesend('everyone in');
9: Typesend('all come in');
10: Typesend('XD');
end;
end else Dec(AntiBansA);
end;
10, 11, 12:
begin
If Walked then Exit;
Walked := True;
Dec(AntiBansA);
Exit;//Needs fixing.
//if not FindColoredAreaTolerance(x, y, DARKWATERCOLORA+CM, MMCX-35, MMCY-35, MMCX+35, MMCY+35, 10, 1) then
//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMUISTA KORJATA ^^
begin
Proggy('Coudn''t find darkwatercolor.');
Exit;
end;
P := RotatePoint(Point(X, Y-3-Random(20)), -rs_GetCompassAngleRadians, X, Y);
GMMouse(P.X, P.Y, 0, 0);
if Loading or InGame then Exit;
GetMousePos(x, y);
GMouse(x, y, 0, 0, true);
Wait(500+random(1000));
end;
end;
Wait(500+random(500));
Gametab(TAB_Inv);
end;


procedure InGameAntiBan;
var
I: Integer;
begin
If(not LoggedIn)then Exit;
Inc(AntiBansA);
MouseSpeed := 12 + Random(5);
Case Random(14) of
0: GMMouse(Random(MIX2), Random(MIY2), 10, 10);
1:
if Random(4) = 1 then HoverSkill('random', False)
else Dec(AntiBansA);
2: PickUpMouse;
3: GameTab(RandomRange(tab_Combat, tab_Notes));
4: IdleTime(100+random(700), 100+Random(100), 0.2+RandomE/2);
5: MakeCompass('S');
6,7:SleepAndMoveMouse(200+Random(Random(4000)));
8,9:GMMouse(0, 0, MSX2, MSX2);
10:
if Random(4) = 1 then
begin
GMouse(Random(MIX2), Random(MIY2), 0, 0, False);
if not ChooseOption('xamine') then ChooseOption('ancel');
end else Dec(AntiBansA);
11: MakeCompass(IntToStr(Random(360)));
12:
begin
if Random(2) = 1 then
begin
KeyDown(VK_LEFT);
if Random(2) = 1 then Wait(400+random(2500))
else SleepAndMoveMouse(400+random(2500));
KeyUp(VK_LEFT);
end else
begin
KeyDown(VK_RIGHT);
if Random(2) = 1 then Wait(400+random(2500))
else SleepAndMoveMouse(400+random(2500));
KeyUp(VK_RIGHT);
end;
end;
13:
begin
I := 500+random(800);
KeyDown(VK_DOWN);
if Random(2) = 1 then Wait(I)
else SleepAndMoveMouse(I);
KeyUp(VK_DOWN);
Wait(100+random(300));
KeyDown(VK_UP);
if Random(2) = 1 then Wait(I+random(400))
else SleepAndMoveMouse(I+random(400));
KeyUp(VK_UP);
end;
end;
Wait(200+random(500));
Gametab(TAB_INV);
end;



function FindTPoints(HueMod, SatMod: Extended; Color, MinMatches, Tol: Integer): TPointArray;
var
I: Integer;
P: TPointArray;
T2D: T2DPointArray;
begin
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(HueMod, SatMod);
FindColorsTolerance(P, Color, MSX1, MSY1, MSX2, MSY2, Tol);
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);
if Length(P) < MinMatches then Exit;
T2D := TPAtoATPAEx(P, 30, 30);
SetLength(P, 0);
for I := 0 to Length(T2D) - 1 do
if Length(T2D[I]) >= MinMatches then
begin
SetLength(Result, Length(Result)+1);
Result[High(Result)] := MiddleTPA(T2D[I]);
end;
SortTPAFrom(Result, IntToPoint(MSCX, MSCY));
end;



function CenterMiddlePoint: TPoint;
var
P: TPointArray;
begin
FindColorsTolerance(P, CenterColorB+FindDarkLadderColor-DarkLadderColorB, MMX1, MMY1, MMX2, MMY2, 0);
Result := MiddleTPA(P);
Result := RotatePoint(IntToPoint(Result.X+5, Result.Y-5), -rs_GetCompassAngleRadians, Result.X, Result.Y);
end;



function Dead: Boolean;
var
x, y: Integer;
begin
if not FindBlackChatMessage('dear') then Exit;
if FindColor(x, y, WaterColorB+FindDarkLadderColor-DarkLadderColorB, MMCX-20, MMCY-20, MMCX+20, MMCY+20) then
begin
Proggy('Died in game');
Result := True;
Inc(DeathsA);
end;
end;


procedure Terminate(Text: String);
begin
Proggy(Text);
WriteLn('Please post this proggy to my thread: [url]http://villavu.com/forum/showthread.php?t=67367');[/url]
if not LastestVersion then WriteLn('There is a new version of this script available at [url]http://villavu.com/forum/showthread.php?t=67367');[/url]
LogOut;
TerminateScript;
end;



function FindGangplank: TPointArray;
var
X, Y: Integer;
begin
Result := FindTPoints(0.10, 0.25, 3694463, 10, 3);
case (boat) of
1:
begin
X := 35;
Y := 0;
end;
2:
begin
X := -35;
Y := 0;
end;
3:
begin
X := -35;
Y := 0;
end;
end;
SortTPAFrom(Result, RotatePoint(Point(MSCX+X, MSCY+Y), -rs_GetCompassAngleRadians, MSCX, MSCY));
end;


function WalkToVoid: Boolean;
var
X, Y: Integer;
P: TPoint;
begin
if (Boat = 3) then
begin
P := RotatePoint(IntToPoint(680, 100), -rs_GetCompassAngleRadians, MMCX, MMCY);
X := P.X;
Y := P.Y;
if not FindColorSpiral(X, Y, FindDarkLadderColor, MMX1, MMY1, MMX2, MMY2) then Exit;
GMouse(X-1, Y-1, 3, 3, True);
Sleep(2500);
Flag;
Sleep(2000);
end;
case (Boat) of
1: P := RotatePoint(IntToPoint(635, 30), -rs_GetCompassAngleRadians, MMCX, MMCY);
2: P := RotatePoint(IntToPoint(680, 50), -rs_GetCompassAngleRadians, MMCX, MMCY);
3: P := RotatePoint(IntToPoint(645, 55), -rs_GetCompassAngleRadians, MMCX, MMCY);
end;
X := P.X;
Y := P.Y;
if not FindColorSpiral(X, Y, FindDarkLadderColor, MMX1, MMY1, MMX2, MMY2) then Exit;
case (Boat) of
1: P := RotatePoint(IntToPoint(X+18, Y-3), -rs_GetCompassAngleRadians, X, Y);
2: P := RotatePoint(IntToPoint(X+15, Y-3), -rs_GetCompassAngleRadians, X, Y);
3: P := RotatePoint(IntToPoint(X+18, Y-3), -rs_GetCompassAngleRadians, X, Y);
end;
GMouse(P.X, P.Y, 2, 2, True);
Sleep(2500);
Flag;
Sleep(2000);
Result := True;
end;

function ExchangeScreen: Boolean;
begin
Result := GetColor(185, 30) = 2070783;
end;

function TalkVoid: Boolean;
var
X, Y, I, Attempts: Integer;
VP: TPointArray;
begin
while (not ExchangeScreen) do
begin
Inc(Attempts);
if Attempts = 15 then
begin
Result := False;
Exit;
end;
if (Attempts = 7) then MakeCompass(rs_GetCompassAngleDegrees+80+Random(2)*180);
VP := FindTPoints(0.00, 0.41, 2171171, 30, 4);
for I := 0 to Length(VP) - 1 do
begin
GMMouse(VP[I].x-1, VP[I].y-1, 3, 3);
if WaitUpTextMulti(['Void', 'Knight'], 500) then
begin
GetMousePos(x, y);
GMouse(x, y, 0, 0, False);
if not WaitOption('xcha', 600) then Break;
Wait(1000+random(600));
Flag;
Wait(2000+random(600));
Break;
end;
end;
Sleep(1000);
end;
Result := True;
end;

function Exchange: Boolean;
begin
Proggy('Exchanging');
Case Lowercase(SpendPointsOn[EX]) of
'attack','att','atk':
begin
GMouse(135, 138, 30, 6, True);
CurrentPointsA := CurrentPointsA-100;
end;
'defence','def':
begin
GMouse(440, 138, 30, 6, True);
CurrentPointsA := CurrentPointsA-100;
end;
'magic','mage':
begin
GMouse(440, 212, 30, 6, True);
CurrentPointsA := CurrentPointsA-100;
end;
'prayer','pray':
begin
GMouse(286, 285, 30, 6, True);
CurrentPointsA := CurrentPointsA-100;
end;
'strength','str':
begin
GMouse(286, 138, 30, 6, True);
CurrentPointsA := CurrentPointsA-100;
end;
'ranged','range':
begin
GMouse(286, 212, 30, 6, True);
CurrentPointsA := CurrentPointsA-100;
end;
'hitpoints','hp','constitution', 'con', 'const':
begin
GMouse(135, 212, 30, 6, True);
CurrentPointsA := CurrentPointsA-100;
end;
'robe', 'robes', 'mage helm','melee helm','top','gloves','ranger helm', 'mace', 'deflector', 'seal':
begin
GMouse(150, 60, 50, 8, True);
Wait(2500+random(900));
case LowerCase(SpendPointsOn[EX]) of
'melee helm':
begin
GMouse(45, 138, 115, 6, True);
CurrentPointsA := CurrentPointsA-200;
end;
'ranger helm':
begin
GMouse(200, 138, 115, 6, True);
CurrentPointsA := CurrentPointsA-200;
end;
'mage helm':
begin
GMouse(350, 138, 115, 6, True);
CurrentPointsA := CurrentPointsA-200;
end;
'top':
begin
GMouse(45, 212, 115, 6, True);
CurrentPointsA := CurrentPointsA-250;
end;
'robes', 'robe':
begin
GMouse(200, 212, 115, 6, True);
CurrentPointsA := CurrentPointsA-250;
end;
'gloves':
begin
GMouse(350, 212, 115, 6, True);
CurrentPointsA := CurrentPointsA-150;
end;
'mace':
begin
GMouse(45, 285, 115, 6, True);
CurrentPointsA := CurrentPointsA-250;
end;
'deflector':
begin
GMouse(200, 285, 115, 6, True);
CurrentPointsA := CurrentPointsA-150;
end;
'seal':
begin
GMouse(350, 285, 115, 6, True);
CurrentPointsA := CurrentPointsA-10;
end;
end;
end;
else
begin
Proggy('No such item as: '+SpendPointsOn[EX]+'.');
Exit;
end;
end;
Wait(1000+random(900));
GMouse(220, 220, 30, 4, True);
Wait(1900+random(900));
Proggy('Succesfully exchanged points in '+SpendPointsOn[EX]);
If EX < Length(SpendPointsOn)-1 then Inc(EX);
Result := True;
end;


function WalkBack: Boolean;
var
X, Y: Integer;
P: TPoint;
begin
P := RotatePoint(IntToPoint(MMCX-6, MMCY-12), -rs_GetCompassAngleRadians, MMCX, MMCY);
X := P.X;
Y := P.y;
FindColorSpiral(X, Y, FindDarkLadderColor, MMX1, MMY1, MMX2, MMY2);
case (Boat) of
1: P := RotatePoint(IntToPoint(X-3, Y+43), -rs_GetCompassAngleRadians, X, Y);
2: P := RotatePoint(IntToPoint(X-41, Y+8), -rs_GetCompassAngleRadians, X, Y);
3: P := RotatePoint(IntToPoint(X-41, Y+8), -rs_GetCompassAngleRadians, X, Y);
end;
X := P.X;
Y := P.y;
FindColorSpiral(X, Y, FindDarkLadderColor, MMX1, MMY1, MMX2, MMY2);
GMouse(X-1, Y-1, 3, 3, True);
Wait(2000);
Flag;
Wait(2000);
if (Boat = 1) then
begin
Result := True;
Exit;
end;
case (Boat) of
2: P := RotatePoint(IntToPoint(612, 100), -rs_GetCompassAngleRadians, MMCX, MMCY);
3: P := RotatePoint(IntToPoint(585, 48), -rs_GetCompassAngleRadians, MMCX, MMCY);
end;
X := P.X;
Y := P.y;
FindColorSpiral(X, Y, FindDarkLadderColor, MMX1, MMY1, MMX2, MMY2);
GMouse(X-1, Y-1, 3, 3, True);
Wait(2000);
Flag;
Wait(2000);
Result := True;
end;


function SpendPoints: Boolean;
begin
if not WalkToVoid then Exit;
if not TalkVoid then Exit;
if not Exchange then Exit;
if not WalkBack then Exit;
Result := True;
end;

function HybridBootsScreen: Boolean;
begin
result := (GetColor(136, 92) = 6668015);
end;

function SelectBootss: Boolean;
begin
if not HybridBootsScreen then Exit;
case (Lowercase(SelectBoots[BootsIndex])) of
'battlemage': GMouse(140, 220, 50, 50, True);
'trickster': GMouse(230, 220, 50, 50, True);
'vanguard': GMouse(320, 220, 50, 50, True);
else Terminate(SelectBoots[BootsIndex]+' boots don''t exist..');
end;
if BootsIndex <> High(SelectBoots) then Inc(BootsIndex);
Result := True;
end;

function FindNPCDotIn(var X, Y: Integer; X1, Y1, X2, Y2: Integer): Boolean;
begin
Result := FindColorTolerance(X, Y, 1830125, X1, Y1, X2, Y2, 50);
end;

function IsLost: Boolean;
var
x, y, I: Integer;
P: TPoint;
begin
while FlagPresent and (I < 99) do
begin
Inc(I);
Sleep(40);
end;
if FindNPCDotIn(X, Y, MMCX-16, MMCY-16, MMCX+16, MMCY+16) and (Distance(MMCX, MMCY, x, y) < 17) then Exit;
case Boat of
1: P := RotatePoint(IntToPoint(670, 140), -rs_GetCompassAngleRadians, MMCX, MMCY);
2: P := RotatePoint(IntToPoint(585, 140), -rs_GetCompassAngleRadians, MMCX, MMCY);
3: P := RotatePoint(IntToPoint(575, 35), -rs_GetCompassAngleRadians, MMCX, MMCY);
end;
x := P.x;
y := P.y;
Sleep(1000);
if not FindColorSpiral(x, y, FindDarkLadderColor, MMX1, MMY1, MMX2, MMY2) then
begin
Result := True;
Exit;
end;
if Boat = 3 then
begin
P := RotatePoint(IntToPoint(x-5, y+6), -rs_GetCompassAngleRadians, x, y);
X := P.x;
Y := P.y;
end;
GMouse(x, y, 2, 2, True);
Wait(2500+Random(1000));
Flag;
Wait(2000+Random(1000));
end;


function GetInBoat: Boolean;
var
x, y, I, Attempts: Integer;
P: TPointArray;
begin
while (not (InBoat or InGame)) do
begin
if not LoggedIn then Exit;
if SolveTeleportRandoms then Wait(4000);
Inc(Attempts);
if IsLost then
begin
Wait(1000);
Continue;
end;
if ((Attempts = 4) or (Attempts = 8)) or (Attempts = 12) then MakeCompass(rs_GetCompassAngleDegrees+85+Random(10)+Random(2)*180);
if (Attempts = 15) then
begin
Result := false;
Exit;
end;
P := FindGangplank;
for I := 0 to Length(P) - 1 do
begin
if (InBoat or InGame) then break;
GMMouse(P[I].x-2, P[I].y-2, 5, 5);
if WaitUpTextMulti(['ross', 'angp', 'lank'], 500+Random(300)) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
WaitFunc(@InBoat, 10, 150+150*Attempts);
Break;
end else Continue;
end;
if InBoat then Break;
if FindNPCChatText('already have', Nothing) then
begin
if not SpendPoints then Terminate('Failed Spending Points');
Attempts := 0;
end;
CloseClanScreen;
SelectBootss;
end;
Result := True;
end;


function Attack: Boolean;
var
x, y, ax, ay, MonsterIndex, ColorINdex, PointIndex, TimeMark, MaxWait: Integer;
MonsterPoints, MonsterPoints2: TPointArray;
CurrentBox: TBox;
Accepted: Boolean;
begin
SetColorToleranceSpeed(2);
for MonsterIndex := 0 to Length(Monsters)-1 do
begin
MonsterPoints := FindTPoints(Monsters[MonsterIndex].Colors[0].Hue, Monsters[MonsterIndex].Colors[0].Sat, Monsters[MonsterIndex].Colors[0].Color, Monsters[MonsterIndex].Colors[0].MinCount, Monsters[MonsterIndex].Colors[0].Tol);
for PointIndex := 0 to Length(MonsterPoints)-1 do
begin
Accepted := True;
CurrentBox := IntToBox(Max(MonsterPoints[PointIndex].X-20, MSX1), Max(MonsterPoints[PointIndex].Y-20, MSY1), Min(MonsterPoints[PointIndex].X+20, MSX2), Min(MonsterPoints[PointIndex].Y+20, MSY2));
for ColorIndex := 1 to Length(Monsters[MonsterIndex].Colors)-1 do
begin
SetColorspeed2Modifiers(Monsters[MonsterIndex].Colors[ColorIndex].Hue, Monsters[MonsterIndex].Colors[ColorIndex].Sat);
FindColorsTolerance(MonsterPoints2, Monsters[MonsterIndex].Colors[ColorIndex].Color, CurrentBox.X1, CurrentBox.Y1, CurrentBox.X2, CurrentBox.Y2, Monsters[MonsterIndex].Colors[ColorIndex].Tol);
if (Length(MonsterPoints2) < Monsters[MonsterIndex].Colors[ColorIndex].MinCount) then
begin
Accepted := False;
Break;
end;
end;
if not Accepted then Continue;
GetMousePos(ax, ay);
if (Distance(ax, ay, MonsterPoints[PointIndex].X, MonsterPoints[PointIndex].Y) > 3) then GMMouse(MonsterPoints[PointIndex].X-2, MonsterPoints[PointIndex].Y-2, 5, 5);
GetMousePos(X, Y);
if (CombatLevel >= Monsters[MonsterIndex].Combat) then
begin
if not (WaitUpTextMulti(['Attack', 'ck Sh', 'ifter'], 200+Random(200)) and FindColorTolerance(ax, ay, 711644, 55, 14, 70, 17, 25)) then Continue;
if Random(13) = 1 then
begin
GMouse(x, y, 0, 0, False);
Result := WaitOption('ttack', 500+Random(500));
Break;
end;
GMouse(X, Y, 0, 0, True);
Result := True;
Break;
end else
begin
GMouse(X, Y, 0, 0, False);
Result := WaitOption('ttack', 500+Random(500));
Break;
end;
end;
if Result then Break;
end;
SetColorspeed2Modifiers(0.2, 0.2);
SetColorToleranceSpeed(1);
If Length(MonsterPoints) > 0 then
begin
MaxWait := 500+Random(1200);
TimeMark := GetTimeRunning;
repeat
sleep(10);
until((GetTimeRunning-TimeMark > MaxWait) or not InGame or Loading);
end;
end;

function WaitForGameStart: Boolean;
begin
Walked := False;
if InBoat then
repeat
if Random(15) = 1 then InBoatAntiBan;
Wait(200+Random(200));
until (not InBoat);
Result := WaitFunc(@InGame, 10, 2000);
end;



function FindCenterColor: Integer;
var
P: TPoint;
TPA: TPointArray;
Colors: TIntegerArray;
I, LengthA, MaxLength, MaxIndex: Integer;
begin
MaxLength := 5;
P := RotatePoint(IntToPoint(627, 155), -rs_GetCompassAngleRadians, MMCX, MMCY);
FindColorsTolerance(TPA, 2846340, P.X-7, P.Y-7, P.X+7, P.Y+7, 40);
Colors := GetColors(TPA);
SetLength(TPA, 0);
ClearSameIntegers(Colors);
for I := 0 to High(Colors) do
begin
FindColors(TPA, Colors[I], P.X-7, P.Y-7, P.X+7, P.Y+7);
LengthA := Length(TPA);
if LengthA > MaxLength then
begin
MaxIndex := I;
MaxLength := LengthA;
if LengthA > 97 then Break;
end;
end;
if MaxLength = 5 then
begin
Result := -1;
Terminate('Failed to find centercolor.');
end else
begin
Proggy('Found centercolor. It is '+IntToStr(Colors[MaxIndex]));
Result := Colors[MaxIndex];
end;
end;

function WalkCenter(Pray: Boolean): Boolean;
var
CP: TPoint;
Dist: Integer;
begin
if (CenterColorB = 0) then
begin
CenterColorB := FindCenterColor;
if (CenterColorB = -1) then Terminate('Couldn''t find centercolor');
CenterColorB := CenterColorB+DarkLadderColorB-FindDarkLadderColor;
end;
CP := CenterMiddlePoint;
Dist := Distance(MMCX, MMCY, CP.X, CP.Y);
if ((Dist < 18) or (Dist > 73)) then Exit;
GMouse(CP.X-2, CP.Y-2, 5, 5, True);
Wait(2000+Random(3000));
if Pray and QuickPray then GMouse(715, 60, 20, 20, True);
Flag;
Result := True;
end;

function GetPoints: Integer;
var
TextNumbers: String;
begin
TextNumbers := GetNumbers(Trim(GetTextAt(114, 78, 0, 3, 0, 16777113, 0, 3, xpchars)));
if Length(TextNumbers) > 0 then
Result := StrToInt(TextNumbers)
else
Result := -1;
end;


function SelectWorldA(world: Integer): Boolean;
var
x, y, xx, yy, i: Integer;
begin
if not LobbyTab(L_WorldSelect) then Exit;
while(not FindText(xx, yy, IntToStr(world), StatChars, 117, 142, 135, 435)) do
begin
Wait(1000);
if i = 0 then
begin
GMMouse(685, 423, 10, 10);
GetMousePos(X, Y);
HoldMouse(X, Y, MOUSE_LEFT);
end;
i := i+1;
if (i > 25) then
begin
ReleaseMouse(X, Y, MOUSE_LEFT);
Exit;
end;
end;
ReleaseMouse(X, Y, MOUSE_LEFT);
Wait(1500+Random(1000));
if not FindText(xx, yy, IntToStr(world), StatChars, 117, 142, 135, 435) then Exit;
GMouse(xx, yy, 50, 5, true);
Result := True;
end;

function Login: Boolean;
begin
if LoggedIn then
begin
Result := True;
Exit;
end;
LoginPlayerToLob;
Wait(1000+Random(500));
if not LobbyScreen then Exit;
Wait(1000+Random(500));
if not selectWorldA(WORLD) then Exit;
Wait(1000+Random(500));
if not LogInPlayer then Exit;
Wait(1000+Random(500));
SetAngle(True);
end;

procedure TakeBreak;
var
BreakTime: Integer;
begin
Logout;
BreakTime := RandomRange(MIN_BREAKTIME, MAX_BREAKTIME);
Proggy('Taking a '+IntToStr(BreakTime/(1000*60))+' minute break!');
Wait(BreakTime);
Login;
NextBreak := GetSystemTime+RandomRange(MIN_NEXTBREAK, MAX_NEXTBREAK);
end;

procedure MainLoop;
var
Points: Integer;
begin
if GetSystemTime > NextBreak then TakeBreak;
SetRun(True);
if not GetInBoat then
begin
Sleep(5000);
if not LoggedIn then Login
else if not SolveTeleportRandoms then Terminate('Couldn''t get in boat');
Exit;
end;
Points := GetPoints;
if Points > 0 then
begin
if CurrentPointsA = 0 then CurrentPointsA := Points
else if (Points > CurrentPointsA) then IncEx(WinsA, (Points-CurrentPointsA)/(Boat+1))
else Inc(LosesA);
CurrentPointsA := Points;
end;
Proggy('Entered the boat');
Stats_Commit;
if not WaitForGameStart then Exit;
Proggy('You board the lander');
WalkCenter(True);
repeat
WalkCenter(False);
if Dead then WalkCenter(True);
Attack;
if Random(15) = 1 then InGameAntiBan;
Wait(100);
while Loading do Wait(10);
until not InGame;
Proggy('Game ended');
stats_IncVariable('Loads Done', 1);
end;

procedure AddColorInfo(var Info: Array of ColorInfo; Color, Tol, MinCount: Integer; Hue, Sat: Extended);
var
H: Integer;
begin
SetLength(Info, Length(Info)+1);
H := High(Info);
Info[H].Color := Color;
Info[H].Tol := Tol;
Info[H].MinCount := MinCount;
Info[H].Hue := Hue;
Info[H].Sat := Sat;
end;


procedure SetupBoatInfo;
begin
case (Boat) of
1:
begin
SetLength(Monsters, 2);
with Monsters[0] do
begin
Name := 'Shifter';//Green
Combat := 57;
AddColorInfo(Colors, 2372377, 7, 15, 0.14, 1.17);//Legs (+1)
AddColorInfo(Colors, 1068354, 9, 10, 0.15, 1.90);//Body (+2)
end;
with Monsters[1] do
begin
Name := 'Shifter';//Red
Combat := 38;
AddColorInfo(Colors, 2703537, 8, 10, 0.26, 1.76);//Body
AddColorInfo(Colors, 4809347, 10, 5, 0.21, 0.07);//Head
AddColorInfo(Colors, 1647183, 8, 10, 0.55, 0.73);//Legs (+3)
end;
end;
2:
begin
SetLength(Monsters, 3);
with Monsters[0] do
begin
Name := 'Shifter';//Green
Combat := 57;
AddColorInfo(Colors, 2372377, 7, 15, 0.14, 1.17);//Legs (+1)
AddColorInfo(Colors, 1068354, 9, 10, 0.15, 1.90);//Body (+2)
end;
with Monsters[1] do
begin
Name := 'Shifter';//BlackRed
Combat := 76;
AddColorInfo(Colors, 3421244, 4, 10, 1.05, 0.36);
end;
with Monsters[2] do
begin
Name := 'Shifter';//Yellow
Combat := 90;
AddColorInfo(Colors, 2280669, 7, 30, 0.21, 2.96);//Legs
AddColorInfo(Colors, 3707570, 9, 30, 0.17, 1.47);//Body
AddColorInfo(Colors, 3002593, 11, 20, 0.13, 1.97);//Head
end;
end;
3:
begin
SetLength(Monsters, 2);
with Monsters[0] do
begin
Name := 'Shifter';//Yellow
Combat := 90;
AddColorInfo(Colors, 2280669, 7, 30, 0.21, 2.96);//Legs
AddColorInfo(Colors, 3707570, 9, 30, 0.17, 1.47);//Body
AddColorInfo(Colors, 3002593, 11, 20, 0.13, 1.97);//Head
end;
with Monsters[1] do
begin
Name := 'Shifter';//Gray
Combat := 104;
AddColorInfo(Colors, 10726569, 6, 10, 0.27, 0.29);
end;
end;
end;
end;

procedure ScriptStartup;
var
Version: String;
begin
NextBreak := GetSystemTime+RandomRange(MIN_NEXTBREAK, MAX_NEXTBREAK);
Smart_Server := 53;
Smart_Members := True;
ClearDebug;
WriteLn('Please wait. Runescape is being loaded.');
SmartSetupEx(Smart_Server, Smart_Members, Smart_Signed, Smart_SuperDetail);
SmartSetRefresh(100);
SetupBoatInfo;
if (SRLStats_Username = '') then
SetupSRLStats(182, 'Anonymous', 'anon1337')
else
SetupSRLStats(182, SRLStats_Username, SRLStats_Password);
WriteLn(GetPage('http://weequ.net/pest_controller/News.txt'));
Version := GetPage('http://weequ.net/pest_controller/Version.txt');
if Version <> '' then
begin
if (StrToFloat(Version) = VERSION_NUMBER) then
begin
WriteLn('You have the lastest version of this script.');
LastestVersion := True;
end else
begin
WriteLn('There is a newer version of this script available. Get it here: http:villavu.com/forum/showthread.php?t=67367');
if MessageBox('There is a new version of this script available!'+chr(13)+'Would you like to open the download page in a new window?', 'Version alarm', 4) = 6 then
begin
OpenWebPage('http:villavu.com/forum/showthread.php?t=67367');
TerminateScript;
end;
end;
end else
begin
WriteLn('Couldn''t check the version number.');
LastestVersion := True;
end;
SetTargetArray(SmartImageArray, 765,503);
while not RSReady do Wait(100);
SetupSRL;
WriteLn('Runescape loaded. Loggin in.');
Login;
DarkLadderColorB := FindDarkLadderColor;
LightLadderColorB := DarkLadderColorB + 591375;
SetupAutoColors;
WaterColorB := AutoColor(srl_WaterColor);
if WaterColorB = -1 then Terminate('Failed to start. Please close Simba and try again. This might happen if too much lagg.');
Mousespeed := 12+Random(5);
CombatLevel := GetCombatLevel;
end;


begin
NumberOfPlayers(1);
CurrentPlayer := 0;
Players[0].Active:= True;
Setup;
ScriptStartup;
while (true) do
begin
MainLoop;
end;
end.

EDIT: Seems to be some sort of Java issue, so I'll look into updating Java.

Even when loading up in a browser, I get frozen up here

Consoles giving me an initiate error so I'll have to look into that.

Stray Bullets

2011-12-15 21:34:29

Heh.. they were apparently trying to fix this issue with that last update.

http://services.runescape.com/m=forum/forums.ws?15,16,63,63450234

And there's a 60 page thread with a ton of complaints relating to this issue.

http://services.runescape.com/m=forum/g=runescape/c=0vtLVlD4NWI/sl=0/forums.ws?25,26,365,63449675

Come Jagex, get it together…

Stray Bullets

2011-12-16 00:10:45

Fixed. able to get all scripts working now xD

Camo Developer thanks for the help

tico2

2012-01-04 17:15:46

I've been dealing with SMART problems for a while now and have finally decided to post it. It's pretty much the same so I didn't bother making a new thread.

Whenever I want to launch a SMART script (pest controller, her cleaner, superheater…) smart won't pop up even if I wait like 10 minutes. If I manully stop the script and try to run it again, it will bring up the same error as above is smart.scar.
SmartSetup('http://'+prefix+'.runescape.com/', ',f5', 765, 503, 's');

I'm not sure what you mean Kyle when you said take that line out. Take it out of the smart.scar? That causes this error for me.

But if I try to launch SMART another time, it will eventually bring up this error.

Microsoft Visual C++ Runtime Library
Runtime Error!
Program C:/Simba/Simba.exe
R605
-pure virtual fonction call

This guy here is also having the same issues.


I've read most of the SMART issues threads but I still can't get it to work. I tried reinstalling my Java, Simba, deleting the Jagex cache and so on but nothing seems to help. It's will just randomly work thou. I'd say once every 30 tries.

All help would be much appreciated :)

Press Play

2012-01-04 17:21:04

I get this sometimes… I just change the SMART server that it loads and this fixes it about 99% of the time!
Smart_Server := 53;
Change that to equal 1, 2, 3 etc.. whatever you want! :P

tico2

2012-01-05 02:04:28

From: -daazndagger-
I get this sometimes… I just change the SMART server that it loads and this fixes it about 99% of the time!
Smart_Server := 53;
Change that to equal 1, 2, 3 etc.. whatever you want! :P


I tried that about 20 times today and SMART didn't launch once :(

Brandon

2012-01-05 02:14:22

Try this:


program new;
{$LoadLib LibSmart}

procedure SmartSetupEx(Server: integer; members, signed, superdetail: boolean);
var
prefix: string;
begin
prefix := ReadINI('World' + IntToStr(Server), 'Prefix', IncludePath + 'SRL/SRL/misc/worlds.ini');
if(prefix = '')then
begin
writeln('Invalid world number or corrupted world list. Please review your settings');
TerminateScript;
end;
SmartSetup('http://'+prefix+'.runescape.com/', 'plugin.js?param=o0,a' + IntToStr((Integer(not(Signed)) + 1) * Integer(not((SuperDetail and Signed)))) + ',m' + IntToStr(Integer(Members)), 765, 503, 's');
end;

begin
SmartSetupEx(1, False, True, False);
end.

OR

Compile and run this C++ code (run the compiled exe in the Plugins folder cuz thats where libsmart.dll is located):


/**
* Copyright 2010 by Benjamin J. Land (a.k.a. BenLand100)
*
* This file is part of the SMART Minimizing Autoing Resource Thing (SMART)
*
* SMART is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SMART is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SMART. If not, see <http://www.gnu.org/licenses/>.
*/

#include <iostream>
#include <windows.h>

using namespace std;

typedef long (*GetFunctionCount) (void) __attribute__((stdcall));
typedef long (*GetFunctionInfo)(int, void*&, char*&) __attribute__((stdcall));
typedef void (*Setup)(char*,char*,long,long,char*) __attribute__((stdcall));

int main(int argc, char** argv) {
HMODULE libsmart = LoadLibrary("./libsmart.dll");
cout << "Library: " << libsmart << '\n';
cout << "GetFunctionCount: " << (void*)GetProcAddress(libsmart, "GetFunctionCount") << '\n';
cout << "GetFunctionInfo: " << (void*)GetProcAddress(libsmart, "GetFunctionInfo") << '\n';
GetFunctionCount count = (GetFunctionCount) GetProcAddress(libsmart, "GetFunctionCount");
GetFunctionInfo info = (GetFunctionInfo) GetProcAddress(libsmart, "GetFunctionInfo");

int exports = count();
cout << "#Exports = " << count() << '\n';
for (int i = 0; i < exports; i++) {
char* def = new char[1024];
void* addr;
info(i,addr,def);
cout << '\t' << addr << " = " << def << '\n';
delete def;
}
cout << "Starting SMART...\n";
Setup setup = (Setup) GetProcAddress(libsmart, "std_setup");
setup((char*)"http://world19.runescape.com/", (char*)",f5", 765, 503,(char*)"");

while (true) Sleep(1000);

return 0;
}

tico2

2012-01-05 12:28:40

From: ggzz
Try this:


program new;
{$LoadLib LibSmart}

procedure SmartSetupEx(Server: integer; members, signed, superdetail: boolean);
var
prefix: string;
begin
prefix := ReadINI('World' + IntToStr(Server), 'Prefix', IncludePath + 'SRL/SRL/misc/worlds.ini');
if(prefix = '')then
begin
writeln('Invalid world number or corrupted world list. Please review your settings');
TerminateScript;
end;
SmartSetup('http://'+prefix+'.runescape.com/', 'plugin.js?param=o0,a' + IntToStr((Integer(not(Signed)) + 1) * Integer(not((SuperDetail and Signed)))) + ',m' + IntToStr(Integer(Members)), 765, 503, 's');
end;

begin
SmartSetupEx(1, False, True, False);
end.

OR

Compile and run this C++ code (run the compiled exe in the Plugins folder cuz thats where libsmart.dll is located):


Thanks for the response. I ran the first script and it succesfully compiles but does nothing. If I stop it and try to run it again, it will put out this error:

Error: Exception: Access violation at line 14
I have no idea how to compile the c++ code. I've tried looking it up but I couldn't figure it out :p

Brandon

2012-01-05 12:49:53

There's a couple things I can think of.. Your running java 7 instead of 6u30..
SmartSetup <– that's line 14.. your simba or whatever is having a hard time accessing smart's internals..

If the C++ code actually works for you then it's a simba problem else it could be java, if not then someone else is going to have to give it a shot.

To compile c++ you can either install Mingw OR the easy way is to use Codeblocks/visual studio.. whichever you have. If you don't have either one and u trust this exe then you can download it.

http://www.multiupload.com/J06R6GW4U9 <— I compiled it myself.. You can compile it if you like with the methods I mentioned above..

Virus Scans:
http://www.virustotal.com/file-scan/report.html?id=fc9f1600e1379f3ad956be2ba407e0c32c5ec8ffcb54cfa57df537965a73ca7e-1325784952

http://virusscan.jotti.org/en/scanresult/49a36bfaac9fea6cb6f5db7ed75271ad22644b7b

No clue what variant is.. Maybe a mod can compile and upload or verify it's clean

tico2

2012-01-05 15:08:22

From: ggzz
There's a couple things I can think of.. Your running java 7 instead of 6u30..
SmartSetup <– that's line 14.. your simba or whatever is having a hard time accessing smart's internals..

If the C++ code actually works for you then it's a simba problem else it could be java, if not then someone else is going to have to give it a shot.

To compile c++ you can either install Mingw OR the easy way is to use Codeblocks/visual studio.. whichever you have. If you don't have either one and u trust this exe then you can download it.

http://www.multiupload.com/J06R6GW4U9 <— I compiled it myself.. You can compile it if you like with the methods I mentioned above..

Virus Scans:
http://www.virustotal.com/file-scan/report.html?id=fc9f1600e1379f3ad956be2ba407e0c32c5ec8ffcb54cfa57df537965a73ca7e-1325784952

http://virusscan.jotti.org/en/scanresult/49a36bfaac9fea6cb6f5db7ed75271ad22644b7b

No clue what variant is.. Maybe a mod can compile and upload or verify it's clean


W0000t! :) Downgrading my Java seemed to do the trick! I'm always updating my stuff with file hippo so I had the latest Java. :p

As for the .exe, of course I trust you :) It brings up this error



Do I need to take care of this or just leave it alone since everything is working fine now?

Anyway, thanks a lot for you help! Some very deserved rep++ from me :D