From: NaumanAkhlaQ
How'd you actually differentiate the different worlds raymond? Like world 136 from world 1? and find which one has the best place for something?
Also Is their a chance this can be added?
Ehm.. This is what my messy loader used to look like..
{.include smart.scar}
var
Worlds,Temp : String;
Function FindWorlds(Members : Boolean): TIntegerArray;
var
I,j,K,T: integer;
WorldListArray : TStringArray;
WorldList : String;
begin;
WorldList := Between('d.write("</tr>");'#10'}'#10#10' '#10' '#10' ','</script>',GetPage('http://www.runescape.com/slj.ws?lores.x=1&plugin=2&order=MPWLA'));
WorldList := Replace(WorldList,#10#10' '#10' '#10' ','');
J := pos(';', WorldList);
repeat
SetArrayLength(WorldListArray, i + 2);
WorldListArray[i] := copy(WorldList, 1, J-1);
delete(WorldList, 1, pos(WorldListArray[i], WorldList)+Length(WorldListArray[i]));
i := i + 1;
J := pos(';', WorldList);
until(J = 0)
SetLength(WorldListArray,I);
SetLength(Result,100);
For I := 0 to Length(WorldListArray) -1 do
begin;
if Not (WorldListArray[I] = '127') then
begin;
J := LastPos(',',WorldListArray[I]);
K := LastPosEx(',',WorldListArray[I],J);
if GetNumbers(Copy(WorldListArray[i],K+1,J-K-1)) <> '0' then
begin;
if members then if WorldListArray[I][Pos(',',WorldListArray[I])+1] = '1' then
begin;
Result[T] := StrToInt(Copy(WorldListArray[i],3,Pos(',',WorldListArray[I])-3));
inc(T);
end;
if not Members then if WorldListArray[I][Pos(',',WorldListArray[I])+1] = '0' then
begin;
Result[T] := StrToInt(Copy(WorldListArray[i],3,Pos(',',WorldListArray[I])-3));
inc(T);
end;
end;
end;
end;
SetLength(Result,T);
end;
procedure SmartSetupEx(Worlds : TIntegerArray; SearchLessCrowded, Member, RandomizeArray, HighDetail, Signed: boolean);
var
Prefix : string;
Used : String;
I,L, II : Integer;
Randomized : TIntegerArray;
begin
SetLength(Randomized,L);
if SearchLessCrowded then
Randomized := FindWorlds(member)
else if RandomizeArray then
begin;
L := Length(Worlds);
For I:= 0 to L - 1 do
Repeat
II := Random(L);
if Randomized[II] = 0 then
Randomized[II] := Worlds[I];
until (Randomized[II] = Worlds[I]);
end else
Randomized := Worlds;
L := Length(Randomized);
Try
Used := ReadInterSCARMessage('SMART_Worlds');
For I:= 0 to L - 1 do
begin;
if (pos('-'+inttostr(Randomized[I])+'-',Used) < 1) and not (Randomized[I] = 127) and not (Randomized[I] = 123) and not (RAndomized[I] = 126) and not (Randomized[I] = 125) then
begin;
Prefix := ReadINI('World' + inttostr(Randomized[I]), 'Prefix', AppPath + 'includes\SRL\SCSS\worlds.ini');
if Prefix = '' then begin;
Writeln('Your world number is invalid! You used number: '+inttostr(Randomized[I]));
Continue;
end;
SendInterSCARMessage('SMART___'+ Inttostr(GetSelf.Handle),IntTostr(Randomized[I]));
SendInterSCARMessage('SMART__'+ Inttostr(GetSelf.Handle),Prefix);
SendInterSCARMessage('SMART_'+ Inttostr(GetSelf.Handle),inttostr(Randomized[I]));
SendInterSCARMessage('SMART_Worlds',Used+'-'+inttostr(Randomized[I])+'-');
Writeln('Loading world '+inttostr(Randomized[I])+'_ '+prefix+' _'+Used);
SmartSetup(Prefix, HighDetail, Signed);
Exit;
end;
end;
except
end;
Writeln('Error or something like that, closing!');
TerminateScript;
end;
begin
Writeln(Apppath);
Worlds := ReadInterSCARMessage('SMART_Worlds');
Temp := '-'+ReadInterSCARMessage('SMART_'+ Inttostr(GetSelf.Handle))+'-';
if Length(Temp) > 2 then
Delete(Worlds,Pos(Temp,Worlds),Length(Temp));
SendInterSCARMessage('SMART_Worlds',Worlds);
if Readln('Erase previous worlds: '+ ReadInterSCARMessage('SMART_Worlds')) <> 'no' then
SendInterSCARMessage('SMART_Worlds','');
SmartSetupEx([], True,false,false,false, false);
// SmartSetup('ny4',false,false);
// SmartSetTarget;
SetTargetDc( SmartGetDC);
wait(5000 + random(5000));
repeat
wait(1000);
until(Smartgetcolor(231, 233)<>1118604);
//SmartClickMouse(741,480,true);
end.
I haven't autoed in six months or so.. So no clue wether its working.
It might be a good addition to SRL indeed. Will look over it ;)