SRL Archive - OSR Help

Two Questions?


PhaseCode

2012-01-06 23:08:19

Hey Guys,

I have to Questions.
1. (I'm going to assume the MMouse method so,) How would one randomly move the mouse off screen, using SMART?
2. Is there any way to get the players Username, not using the Declare Players

Thanks!~

Kyle Undefined

2012-01-06 23:26:27

1) Using SMART, there is no area to move mouse off of. However, I'm sure you could try adding huge random areas to the MMouse();

2) DeclarePlayers sets up the players so you can do "Players[CurrentPlayer].Name"

Brandon

2012-01-06 23:40:25

Without using Declare players, It's not too hard.. just check out the code below.. it should get most if not all player names.. Player must be logged in though else there is no other ways.


Function GetPlayerName: String;
var
B: TBox;
Str: String;
I: Integer;
begin
B:= IntToBox(8, 458, 129, 476);
Str:= Trim(GetTextAtExWrap(B.X1, B.Y1, B.X2, B.Y2, 0, 5, 2, 0, 4, SmallChars));

For I:= 1 To High(Str) do
if (ord(Str[I]) = 32) then //32, 183, 183, 0 ....... 32, 183, 183 = weird ASCII chars from the quickchat bubble.. 0 = Null-T..
break;

if (I <> 0) then
Delete(Str, I, I);

Result := Str;
end;

begin
writeln(GetPlayerName);
end.