SRL Archive - Help and Support

Round Mark.


faster789

2008-04-20 18:49:23

Helo, guys.
I was wandering if anyone can tell me what procedure/function I suppose to use to do this task. I want the player runing the script be able to type on which load they want the character to log out. So for example lets say they wrote 5. Then, I want my script to see if the loads they did is dividable by 5. If yes, the script should logout. Make sense? So if they did 10 loads the script should find that 5 can go into 10. So it should logout.

Can someone tell me the procedure/function to do the above task?
Thanks.
Faster789 aka
Bobo

Zezi

2008-04-20 20:17:25

Took me a while to understand wtf you meant !

I'm not too experianced with scar, but try this XD


if(runs >= 5) then
begin
sleep;
runs: 0;
end;

Although i suppose in the long run this wouldn't really keep track of the main amount of runs, so try to do something like


procedure mainloop;
begin
repeat
runtotal:= runtotal +1;
totalsleep: =totalsleep +1;
if(totalsleep >= 5) then
sleep;
totalsleep:= 0;
until(runtotal > 200);
end;

if you know what i mean… i've kinda forgotten how to scar in a short amount of time XD

Santa_Clause

2008-04-20 21:11:31

if LoadsDone mod 5 = 0 then
NextPlayer(True);

Mod returns the remainder, so LoadsDone mod 5 returning 0 means that if you divide LoadsDone by 5, the remainder will be 0.

Zezi

2008-04-20 21:17:59

From: Santa_Clause
if LoadsDone mod 5 = 0 then
NextPlayer(True);

Mod returns the remainder, so LoadsDone mod 5 returning 0 means that if you divide LoadsDone by 5, the remainder will be 0.


Omfg! my freind had suggested for me to do this also! But then i said 'nah i cba my way works'

He also tried this before hand :

if !LoadsDone%5 = 0 then
NextPlayer(True);

Then he suggested to use 'mod' afterwords XD

Santa_Clause

2008-04-20 21:41:48

Which friend are you talking about…because the way he tried in the beginning looks weird :p

Smartzkid

2008-04-20 22:56:14

% just means mod in some programming languages :)

n3ss3s

2008-04-21 07:17:36

Your friend's thing's logic is Java, he tries to say that
If LoadsDone Mod 5 <> 0 Then
NextPlayer which is wrong =D

Bobarkinator

2008-04-21 08:08:27

Yep % and ! are used in languages derived from C++/C

Zezi

2008-04-21 11:56:53

From: n3ss3s
Your friend's thing's logic is Java, he tries to say that
If LoadsDone Mod 5 <> 0 Then
NextPlayer which is wrong =D


I thought '!' the reversed that? :S

*scratches head* he's a php and javascript and ajax nerd :(

I tried to get him to join srl but he says it's too inferior for him :D!