Results 1 to 6 of 6

Thread: a few simple questions

  1. #1
    Join Date
    Mar 2006
    Posts
    201
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default a few simple questions

    is there a command to just stop whatever the script it doing. lets say for instance i set it to do something for 10 seconds, but if it spots this color it stops what it was doing and goes to the next command.

    also just to clarify, if a command returns a result, you can use result = *** to assign it to a variable?
    |>|-|33|2 /\/\ '/ 1337 |-|@>< 0|2 |)1 3

    " There are no stupid questions, only stupid people "

  2. #2
    Join Date
    Feb 2006
    Posts
    582
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If it is in a loop.. you can use Exit;
    Free File Hosting
    No download timers!

    Rifkwtf.com

  3. #3
    Join Date
    Feb 2006
    Location
    Aussie
    Posts
    937
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i think you need result:= *** i can't think properly at the moment...

  4. #4
    Join Date
    Feb 2006
    Location
    Las Vegas, NV
    Posts
    939
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    use 'result:=blah' in a function like below
    Code:
    function BlahFound:Boolean;
    begin
      if(blahblah=blah)then
        begin
          result:=true
        else
          result:=false
    end;
    this would return true if it blahblah=blah.. so for instance if it finds a color then it will return true, otherwise false..
    it can also be used with integers and other variables like so
    Code:
    function BlahNumber:Integer;
    begin
      if(blahblah=blah)then
        begin
          result:=13
        else
          result:=0
    end;
    this is very useful as it kind of eliminates lots of coding.. one example is the LoggedIn function..

    hope that helps
    Busy with real life. I'll still be around occasionally.
    Current Mood:


  5. #5
    Join Date
    Mar 2006
    Posts
    201
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thank you helped alot
    |>|-|33|2 /\/\ '/ 1337 |-|@>< 0|2 |)1 3

    " There are no stupid questions, only stupid people "

  6. #6
    Join Date
    Feb 2006
    Location
    Australia, NSW.
    Posts
    1,461
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Just some other useful commands.

    Break: if in a loop then it exits it, Example:
    Code:
    var i: integer;
    begin
     repeat
       wait(200);
      i:= i + 1;
       if (i = 5) then
         break;
       writeln(inttostr(i));
     until(false);
      writeln('i is now 5.');
    end.
    Exit: Exits a procedure or function and continues on the main loop:
    Code:
    procedure Hi;
    var i: Integer;
    begin
      repeat
        wait(20);
       i:= i + 1;
       if (i = 20) then
         exit;
        writeln(inttostr(i));
      until(false);
       Writeln('The script never reaches here due to the exit.');
    end;
    
    begin
      Hi;
      Writeln('Continueing..');
    end.
    Terminatescript: Immediatly stops the script wherever:
    Code:
    begin
      Terminatescript;
      Writeln('...');
    end.
    or:
    Code:
    procedure Wee;
    begin
      Terminatescript;
    end;
    
    begin
      Wee;
      Writeln('..');
    end.
    <3

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Some simple questions.
    By The! in forum OSR Help
    Replies: 2
    Last Post: 08-08-2008, 12:27 AM
  2. Replies: 5
    Last Post: 03-26-2007, 07:57 PM

Posting Permissions

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