SRL Archive - Bugs

procedure DoTMe


Alien Technology

2010-11-12 12:08:16

I am running this script which contains the procedure DoTMe which I found in this tutorial: http://villavu.com/forum/showthread.php?t=59400

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

// Quote: "Getting other player data is not so useful, but the key part is your own data. This is where you can get your levels, prayer points, HP level in the middle of a fight...etc.

// Who wants to hover over your name for the skill experience? Why not just do it in one shot?

// It's also one simple line (of Pascal code)!"

program DoTMe;
{$define SMART} // This is how we include SMART; it HAS to be included BEFORE SRL!
{$i srl/srl.scar}
{$i reflection\reflection.simba}

var Me : TMe;
// By Naike
procedure DoTMe;
var
I: Integer;
begin
Repeat
Me := GetMe
Writeln('--Me--');
Writeln('Name: ' + Me.Name + '(' + ToStr(Me.Tile.X) + ', ' + ToStr(Me.Tile.Y) + ') LoginIndex: ' + ToStr(Me.LoginIndex) + ' - Speed:' + ToStr(Me.Speed));
Writeln(' Orientation: ' + ToStr(Me.Orientation) + ' - Combat: ' + ToStr(Me.Level) + ' - Animation:' + ToStr(Me.Animation) + + ' - HPRatio:' + ToStr(Me.HPRatio));
Writeln(' TurnDirection:' + ToStr(Me.TurnDirection) + ' - InFight:' + ToStr(Me.InFight) + ' - Interacting:' + ToStr(Me.Interacting) + ' - Height:' + ToStr(Me.Height));
Writeln(' Levels/Exp:');
For I:=0 to High(Me.Levels) do
Writeln(' Ind[' + ToStr(I) + '] Level:' + ToStr(Me.Levels[I]) + ' Experience: ' + ToStr(Me.Experience[I]));

Writeln('');
Writeln(' Equipment:');
For I:=0 to High(Me.Equipment)do
Writeln(' Ind[' + ToStr(I) + '] ID: ' + ToStr(Me.Equipment[I]));

Wait(3000);
ClearDebug;
Until(True);
end;

procedure DeclarePlayers;
begin
HowManyPlayers := 1; // This is set to the total amount of players (more on multiplayer later ;)), for now, just keep it set as 1
NumberOfPlayers(HowManyPlayers); // This is a procedure in SRL which sets up player arrays (also, more on that later), this will always be the same
CurrentPlayer := 0; // This is the player to start with; the first player will always be 0 (you'll find out when you learn all about arrays)

Players[0].Name := 'uuuuuu'; // Username
Players[0].Pass := 'pppppp'; // Password
Players[0].Nick := 'nnnn'; // 3-4 lowercase letters from username; used for random event detection
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
end;

begin
// These 4 lines HAVE to be set BEFORE you call SetupSRL;

// From http://villavu.com/wiki/How_to_make_any_Script_a_S.M.A.R.T_Script

// Quote: "This extra work is completely optional. If you are fine with the default settings you do not have to set these (i.e., the four variables prefixed with "Smart_")."

// commented out Smart_Server := 152;
// commented out Smart_Members := False;
// commented out Smart_Signed := True;
// commented out Smart_SuperDetail := False;

ClearDebug;
SetupSRL;
DeclarePlayers; // Calls the procedure, you can't forget this!
LoginPlayer; // You want your player to login, right?
DoTMe;
end.
These are the results:

     .
.
.
formWriteln: 1
formWriteln: 2
formWriteln: 4
formWriteln: Welcome to Runescape.
formWriteln: Uuuuuu
formWriteln: 5
formWriteln: 1
formWriteln: 2
Field not found: yc
formWriteln: --Me--
formWriteln: Name: Uuuuuu(3111, 3254) LoginIndex: 0 - Speed:0
formWriteln: Orientation: 180 - Combat: 4 - Animation:-1 - HPRatio:0
formWriteln: TurnDirection:0 - InFight:False - Interacting:-1 - Height:222
formWriteln: Levels/Exp:
formWriteln: Ind[0] Level:0 Experience: 0
formWriteln: Ind[1] Level:0 Experience: 0
formWriteln: Ind[2] Level:0 Experience: 0
formWriteln: Ind[3] Level:0 Experience: 0
formWriteln: Ind[4] Level:0 Experience: 0
formWriteln: Ind[5] Level:0 Experience: 0
formWriteln: Ind[6] Level:0 Experience: 0
formWriteln: Ind[7] Level:0 Experience: 0
formWriteln: Ind[8] Level:0 Experience: 0
formWriteln: Ind[9] Level:0 Experience: 0
formWriteln: Ind[10] Level:0 Experience: 0
formWriteln: Ind[11] Level:0 Experience: 0
formWriteln: Ind[12] Level:0 Experience: 0
formWriteln: Ind[13] Level:0 Experience: 0
formWriteln: Ind[14] Level:0 Experience: 0
formWriteln: Ind[15] Level:0 Experience: 0
formWriteln: Ind[16] Level:0 Experience: 0
formWriteln: Ind[17] Level:0 Experience: 0
formWriteln: Ind[18] Level:0 Experience: 0
formWriteln: Ind[19] Level:0 Experience: 0
formWriteln: Ind[20] Level:0 Experience: 0
formWriteln: Ind[21] Level:0 Experience: 0
formWriteln: Ind[22] Level:0 Experience: 0
formWriteln: Ind[23] Level:0 Experience: 0
formWriteln: Ind[24] Level:0 Experience: 0
formWriteln:
formWriteln: Equipment:
formWriteln: Successfully executed.
.
.
.

Please note:
"Field not found: yc"

Also, the equipment fields did not print.

Any suggestions?

traveler

2010-11-12 12:36:09

your hooks are outdated. i believe thats what the "Field Not Found: yc" means

This script works fine more me, and also, looking at the GetMe command, it looks like it does not find equipment.

E: i see about all the levels getting zero. add wait(1000); after LoginPlayer; LoginPLayer quits before the player is fully loggedin, and therefore it messes up with the GetMe command.

Alien Technology

2010-11-12 13:49:56

Thanks for the quick reply, traveler.

I found out that I was missing SetUpReflectionEx(true); after SetupSRL; as described in Up-to-date Reflection Tutorial (as of Oct 8, 2010).

I reran the script with just this change, but there was no difference in the results.

I found my way to Reflection –> Reflection Development –> Client Hacking in the SRL Forum.

#628 was denoted as a false alarm.

I am using Simba. I just updated Reflection this morning when I installed Simba.

I looked in Hooks.simba. It is version #627.

Any suggestions?

Cstrike

2010-11-12 14:02:43

From: Alien Technology
Thanks for the quick reply, traveler.

I found out that I was missing SetUpReflectionEx(true); after SetupSRL; as described in Up-to-date Reflection Tutorial (as of Oct 8, 2010).

I reran the script with just this change, but there was no difference in the results.

I found my way to Reflection –> Reflection Development –> Client Hacking in the SRL Forum.

#628 was denoted as a false alarm.

I am using Simba. I just updated Reflection this morning when I installed Simba.

I looked in Hooks.simba. It is version #627.

Any suggestions?


Try this, I just did it and it worked for me and told me my level accurately:

program Test;
{$i srl/srl/misc/smart.scar}
{$i srl/srl.scar}
{$i reflection/reflection.simba}

procedure DeclarePlayers;
begin
NumberOfPlayers(1);
SMART_Server := 121;
SMART_Signed := True;

with Players[0] do
begin
Name :='';
Pass := '';
PIN := '';
Active := True;
end;
end;

procedure DumpTMeData;
var Me : TMe;
begin
Me := GetMe;
writeln ('Got Data for ME');
wait (500+random(500));
writeln ('Attack level = '+ToStr(Me.Levels[0]));
end;

procedure SetMeUp;
begin
Smart_Server := 157;
Smart_Members := false;
Smart_Signed := true;
Smart_SuperDetail := false;
ActivateClient;
SetupSRL;
SetupReflectionEx(true);
DeclarePlayers;
LoginPlayer;
ClearDebug;
Wait (410+random(1770));
//SetAngle(true);
//MakeCompass ('n');
//SetRun(true);
end;

begin
SetMeUp;
DumpTMeData;
end.

Tell me how it goes for you :)

Alien Technology

2010-11-12 14:46:08

Thanks for the quick reply, cstrike.

That worked much better.

Here are the results:

formWriteln: Welcome to Runescape.
formWriteln: Uuuuuu
formWriteln: 5
formWriteln: 1
formWriteln: 2
Field not found: yc
formWriteln: Got Data for ME
formWriteln: Attack level = 5
formWriteln: Successfully executed.

I found that the only difference was that I was declaring the variable Me outside of my procedure DoTMe;, while you were declaring the variable Me inside your procedure DumpTMeData;.

I changed it in my script, reran it, and got these results for my recently created character:


formWriteln: Welcome to Runescape.
formWriteln: Uuuuuu
formWriteln: 5
formWriteln: 1
formWriteln: 2
Field not found: yc
formWriteln: --Me--
formWriteln: Name: Uuuuuu(3111, 3254) LoginIndex: 0 - Speed:0
formWriteln: Orientation: 180 - Combat: 4 - Animation:-1 - HPRatio:0
formWriteln: TurnDirection:0 - InFight:False - Interacting:-1 - Height:222
formWriteln: Levels/Exp:
formWriteln: Ind[0] Level:5 Experience: 407
formWriteln: Ind[1] Level:1 Experience: 0
formWriteln: Ind[2] Level:1 Experience: 0
formWriteln: Ind[3] Level:10 Experience: 1289
formWriteln: Ind[4] Level:1 Experience: 0
formWriteln: Ind[5] Level:3 Experience: 189
formWriteln: Ind[6] Level:1 Experience: 0
formWriteln: Ind[7] Level:1 Experience: 0
formWriteln: Ind[8] Level:23 Experience: 6812
formWriteln: Ind[9] Level:1 Experience: 0
formWriteln: Ind[10] Level:1 Experience: 0
formWriteln: Ind[11] Level:2 Experience: 160
formWriteln: Ind[12] Level:1 Experience: 0
formWriteln: Ind[13] Level:1 Experience: 0
formWriteln: Ind[14] Level:6 Experience: 603
formWriteln: Ind[15] Level:1 Experience: 0
formWriteln: Ind[16] Level:1 Experience: 0
formWriteln: Ind[17] Level:1 Experience: 0
formWriteln: Ind[18] Level:1 Experience: 0
formWriteln: Ind[19] Level:1 Experience: 0
formWriteln: Ind[20] Level:1 Experience: 0
formWriteln: Ind[21] Level:1 Experience: 0
formWriteln: Ind[22] Level:1 Experience: 0
formWriteln: Ind[23] Level:1 Experience: 0
formWriteln: Ind[24] Level:1 Experience: 0
formWriteln:
formWriteln: Equipment:
formWriteln: Successfully executed.

Hooray.

Duh duh duh Another one bites the dust. :spot: