Results 1 to 9 of 9

Thread: Math Help!

  1. #1
    Join Date
    Oct 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Math Help!

    SCAR Code:
    if(not(LoggedIn))then
       NextPlayer(False)
      if(PlayerStartTime>=Players[CurrentPlayer].Integer1*60)then
       NextPlayer(True)
        until(ScriptTime(1)>=24)
    end.

    That is inside my Main Loop.

    SCAR Code:
    Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := '';
      Players[0].Active := True;
      Players[0].Skill := 'strength';
      Players[0].Integer1 := 5

    That is an example of a player.

    The integer1 represents how long you want the player to run for in minutes.
    All it does however, is attempts to attack a man, then just logs out... Help ASAP please!

  2. #2
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    For minutes do *1000*60.
    Set PlayerStartTime as a timemark and use TimeFromMark(PlayerStartTime) >= ...

    So it would be

    SCAR Code:
    MarkTime(PlayerStartTime);
      repeat
        //mainloop
      until (TimeFromMark(PlayerStartTime) >= (Players[CurrentPlayer].integer1 *1000 *60))
    Hup Holland Hup!

  3. #3
    Join Date
    Oct 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    begin
    MarkTime(PlayerStartTime);
      IntroText;
      ScriptSetup;
        NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
      repeat
      ManClick;

      if(not(LoggedIn))then
       NextPlayer(False)
      if((PlayerStartTime)>=Players[CurrentPlayer].Integer1*60)then
       NextPlayer(True)
        until(ScriptTime(1)>=24)
    end.

    How do I implement that method into that..?

  4. #4
    Join Date
    Aug 2006
    Posts
    408
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Change this line:
    SCAR Code:
    if((PlayerStartTime)>=Players[CurrentPlayer].Integer1*60)then
    to this:
    SCAR Code:
    if((PlayerStartTime)>=Players[CurrentPlayer].Integer1*60*1000)then

    Remember, you have to count in miliseconds.

  5. #5
    Join Date
    Oct 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  6. #6
    Join Date
    Oct 2006
    Posts
    161
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    maybe add another var something like nowtime, then subtract startTime from nowtime
    to see how long player has been playing

    begin
    MarkTime(PlayerStartTime);
    IntroText;
    ScriptSetup;
    NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    repeat
    ManClick;
    Marktime(NowTime);
    if(not(LoggedIn))then
    NextPlayer(False)
    if((NowTime) - (PlayerStartTime) >= Players[CurrentPlayer].Integer*1000*60)then
    NextPlayer(True)
    logout;
    until(false)
    end

  7. #7
    Join Date
    Oct 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  8. #8
    Join Date
    May 2007
    Location
    http://www.srl-forums.com
    Posts
    265
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    what kind of script are you trying to make?

  9. #9
    Join Date
    Oct 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •