Torrent of Flame
2011-12-13 13:30:53
Good. Good. How's the kids? Good. Alright. See you later.
Good day!
How goes it in the world of SRL?
It seems like an age ago I made an actual post of my own. Infact, it was on the 13th April! My god, which was to post the last piece of code I've written..
In case you were curious..
Is everyone from.. about a year ago.. still knocking about?
Yeah how are you all! If you're curious about moi..
I might start on a little project back here, so if there's anything that the mighty MSI hasn't built yet, let me know!
See you around!
Josh
x
Good day!
How goes it in the world of SRL?
It seems like an age ago I made an actual post of my own. Infact, it was on the 13th April! My god, which was to post the last piece of code I've written..
program SoulWars;
{$DEFINE SMART}
{$i SRL/SRL.scar}
{$i Reflection/Reflection.simba}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // your username
Players[0].Pass := ''; // your password
Players[0].Nick := ''; // 3-4 letters of your username
Players[0].Active := True; //Use this player or not?
end;
var
Team: integer;
{////////////////////////////////////////////////////////////////////////////////
Load Path
Path tiles for walking
////////////////////////////////////////////////////////////////////////////////}
function LoadPath(Path:Integer): TPointArray;
var
i, t: integer;
begin
if(Path = 0) then
begin
SetLength(Result, 1);
Result[0] := Point(1890, 3164);
end;
if (Path = 1) then
{BLUE RUN FROM INITIAL SPAWN}
begin
SetLength(Result, 2);
Result[0] := Point(1806, 3234);
Result[1] := Point(1806, 3247); //To Supplies
end;
if (Path = 2) then
begin
SetLength(Result, i);
for t := 0 to High(i) do
Result[t] := [Point(1967, 3231), Point(1967, 3216),
Point(1951, 3216), Point(1938, 3228),
Point(1923, 3235), Point(1922, 3239),
Point(1908, 3247){GETS TO NW OF OUTER GRAVEYARD SPAWN}]
end;
end;
{////////////////////////////////////////////////////////////////////////////////
Walk the Path
Walks to places..
////////////////////////////////////////////////////////////////////////////////}
function WalkThePath(PathNo: integer): boolean;
var
p: integer;
Path: TPointArray;
begin
if not LoggedIn then
Exit;
Path := LoadPath(PathNo);
for p := 0 to High(Path) do
begin
WalkToTile(Path[p], 1, 0);
FFlag(0);
Result := True;
end;
end;
{////////////////////////////////////////////////////////////////////////////////
Which Team
Determines what team we will be playing for
////////////////////////////////////////////////////////////////////////////////}
function WhichTeam: boolean;
var
rTile, bTile: TPoint;
begin
rTile := TileToMM(Tile(1930, 3173));
bTile := TileToMM(Tile(1872,3151));
if not rs_OnMiniMap(rTile.X, rTile.Y) then
if not rs_OnMiniMap(bTile.X, bTile.Y) then
begin
Writeln('Not in a portal, exiting..');
Exit;
Result := False;
end else
if rs_OnMiniMap(rTile.X, rTile.Y) then
begin
Team := 0;
end else
Team := 1;
if Team = 0 then
begin
Writeln('Playing for Red Team.');
end else
Writeln('Playing for Blue Team.');
end;
{////////////////////////////////////////////////////////////////////////////////
Check Chats
Enters Balance Portal if the warning about zeal comes up
////////////////////////////////////////////////////////////////////////////////}
function CheckChats: boolean;
begin
Wait(2000+Random(250));
begin
if FindNPCChatText('Warning', Nothing) then
begin
ClickContinue(True, False);
end ;
Wait(1500+Random(250));
if FindNPCChatText('Enter portal.', ClickLeft) then
Result := True;
end;
end;
{////////////////////////////////////////////////////////////////////////////////
Enter Portal
Enters Balance Portal using reflection.
////////////////////////////////////////////////////////////////////////////////}
function Enter_Portal: Boolean;
var
x, y, portalID: Integer;
MSPoint: TPoint;
begin
portalID := GetObjectAt(Point(1890, 3163),0).ID;
if (portalID = 42031) then
begin
MSPoint := TileToMS(Point(1890, 3163), 10);
MMouse(MSPoint.x, MSPoint.y, 10, 5);
wait(100 + Random(30));
getMousePos(x, y);
Mouse(x, y, 1, 1, True);
Result := True;
Writeln('Clicked Balance Portal');
end;
CheckChats;
Wait(2000+Random(250));
WhichTeam;
end;
{////////////////////////////////////////////////////////////////////////////////
Leave Spawn
Leaves red or blue initial spawn points
////////////////////////////////////////////////////////////////////////////////}
function LeaveSpawn: boolean;
var
MSPoint: TPoint;
x, y: integer;
ITile: TTile;
begin
if Team = 0 then
begin
ITile := Point(1958, 3239);
end else
ITile := Point(1958, 3239);
begin
WalkToTile(ITile, 1, 0);
MakeCompass('W');
MSPoint := TileToMS(ITile, 1);
MMouse(MSPoint.x, MSPoint.y, 2, y-RandomRange(45,55));
wait(100 + Random(30));
getMousePos(x, y);
Mouse(x, y, 1, 1, True);
Writeln('Left Spawn Point');
Result := True;
end;
end;
{////////////////////////////////////////////////////////////////////////////////
The main Soul Wars runtime loop
Enters Balance Portal using reflection.
////////////////////////////////////////////////////////////////////////////////}
function Play_SW: boolean;
begin
if Team = 0 then
begin
//Do this shit
end;
if Team = 1 then
begin
//Do this shit
end;
end;
{////////////////////////////////////////////////////////////////////////////////
Script Setup
Standard Script Setting up stuff.
////////////////////////////////////////////////////////////////////////////////}
procedure Script_Setup;
begin
Smart_Signed := True;
Smart_Server := 59;
Smart_SuperDetail := False;
SetupSRL;
SetupReflection;
DeclarePlayers;
LoginPlayer;
end;
begin
Script_Setup;
WalkThePath(0);
Enter_Portal;
// LeaveSpawn;
//WalkThePath(1);
end.In case you were curious..
Is everyone from.. about a year ago.. still knocking about?
Yeah how are you all! If you're curious about moi..
- I got 2 A's and a B at A Level, in Sociology, ICT and Media, respectively
- I have a job as a Web Developer
- I'm currently learning ColdFusion and MySQL, due to my job as a Web Developer..
- I got back with my girlfriend (:D)
- I passed my driving test.. and got a car.
- I've started training Karate every week
I might start on a little project back here, so if there's anything that the mighty MSI hasn't built yet, let me know!
See you around!
Josh
x