SRL Archive - OSR Help

First Script Help on Form-Client relation


alejandr0

2013-08-17 17:52:50

First of all, hi everybody. I'm totally new on posting at this forums and I came here because I'm having some trouble scripting my first script (Woodcutting script). So, I've followed beginner's tutorial plus some specific guides (like 'First Script Woodcutting' or 'Anti Bans and Anti Randoms' and some forms guides too, for example) and then I decided to gather all the knowledge that I had and improve the 'First Script concept'. I've already made a functional woodcutting script, it logins and start cutting willows then it drops them all when InvFull and stuff like that.. I've also implemented anti bans but not yet anti randoms, I created a form too and implemented it on my script. And here begins my problem!
My form is quite simple, it just has an username and password TEdit box and a button to start/stop my script. I've managed to declare player with the information wrote on username and password boxes and it worked (the script would login and run perfectly) but the 'Start' button didn't start my script at all (I had to close my form and then it would login and start the script normally). So, I've managed to activate client by clicking on start button (as it should be!) but now it doesn't recognize the username neither password.Text . It keeps saying: Player Name Not Entered, Or Set P07_PlayerName and P07_PlayerPass Before SetupP07Include. Here is the debug box:



Compiled successfully in 1825 ms.
SRL Compiled in 0 msec
Loading SMART: (url here -> I can't post links yet)
Checking P07Include VersionNumber
Local : 1.7 / Latest : 1.7
You Have The Latest Version of P07Include
Welcome to Project RS06
Enter your username & password
Player Name Not Entered, Or Set P07_PlayerName and P07_PlayerPass Before SetupP07Include.

Anyone has an idea of what I'm doing wrong? I have further questions but I'm fine for now just need to solve this to continue scripting, it's my first script but I'm really motivated to keep scripting since I'm studying at the college to be programmer and I find this a really good hobby.

PD- If you want I can give you the code and excuse my English it's not my main language :D

Thanks and I hope you can help me!

rj

2013-08-17 19:13:04

Can we see the script? Forms can be tricky at times

alejandr0

2013-08-17 19:24:12

Sure, here is the .simba file (I can copy the code, but I think it's easier to understand the code this way)

rj

2013-08-17 19:34:28

Oh I see, you never saved the password:

procedure OnButtonClick(Sender: TObject);

begin
if (btn1.Visible = False) then
begin
btn1.Visible := True;
TerminateScript;
Logout;
end

else
btn1.Visible := False;

if(btn2.Visible = False) then
begin
btn2.Visible := True;
SetupSrl;
SetupP07Include;
ActivateClient;
P07_LoginPlayer;

end

else
btn2.Visible := False;
end;

to save the password do:

P07_PlayerName := username.Text; // Username
P07_PlayerPass := password.Text;
frm1.close;

in the onclick procedure(you had it in declare players, im not sure how the script redirected it to there…)

alejandr0

2013-08-17 19:44:25

That was it, thank you. Now I have trouble on logging out/closing form/stop script just by clicking on the button but I'll find a way to run that.

Again, thank you very much really appreciated!