Results 1 to 9 of 9

Thread: Really Bored

  1. #1
    Join Date
    Nov 2006
    Location
    Wisconsin
    Posts
    1,629
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default Really Bored

    OK this is what i want to do.

    I want scar to choose a random thing to say from a list. This list is over 200 things long.

    I want this to choose a random thing in the list or follow in order does not matter, but then after it has done saying one thing in the list i want it to go to the next and then not reuse the other.

    Is there a way to do this such as declare each as a variable? I know about a lot of things in scar but i can't figure out a "random chooser" of sorts.

    Any ideas?

  2. #2
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    A massive array would work for saying stuff in order.

    SCAR Code:
    procedure SayStuff;
    var
     Message: array [0..200] of String;
     f:integer;

    begin
     message[0]:='this';
     message[1]:='is';
     message[2]:='really';
     message[3]:='boring';
    //... all the way down to the last one.

        for f:=0 to 200 do
         writeln(message[f]);
    end;

    You can also do a random chooser like this. (although, I'd have to think about how to make it not use that phrase again.)

    SCAR Code:
    procedure saystuff;
    var
     message:string;
    begin
      case random(200) of
     0: Message:='this';
     1: Message:='is';
     2: Message :='boring';
      end;
    end;

  3. #3
    Join Date
    Jul 2006
    Posts
    152
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    case random(200) of
    1: blah blah...
    2: blah blah...
    etc...
    end;

    beat me too it :-p well yea there are more than one ways to do it, I recommend his way ^^

  4. #4
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    While both of the above solutions will work, there is a chance that they will repeat things. The below procedure will say everything once and only once, and could easily be converted to say things once, until there is nothing left to say, then to start over.

    SCAR Code:
    usedlist:array[1..200] of boolean; //put under 'var'
    ....
    procedure sendthing(whatthing:integer);
    begin
    if(usedlist[whatthing]=false)then
    typesend(stuffarray[whatthing]);
    end
    usedlist[whatthing]:=true;
    end;
    ....
    sendthing(random(200));

    for that to work, the list has to be in an array of strings:

    SCAR Code:
    stuffarray[0]:='Hey';
    stuffarray[1]:='Wassup?';
    ...
    Interested in C# and Electrical Engineering? This might interest you.

  5. #5
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yea, that would work for the random one. My first example will only repeat things once, and but in order. I forgot to add one piece to make it only go through once.

    SCAR Code:
    procedure SayStuff;
    var
     Message: array [0..200] of String;
     f:integer;
     
    begin
     message[0]:='this';
     message[1]:='is';
     message[2]:='really';
     message[3]:='boring';
    //... all the way down to the last one.
     
        for f:=0 to 200 do
         begin
          writeln(message[f]);
          if (f=200) then
             TerminateScript;
         end;
    end;

  6. #6
    Join Date
    Nov 2006
    Location
    Wisconsin
    Posts
    1,629
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Wow, thanks for the quick replies. Hopefully i can get this finished in the next couple of days as it is a project for school.

  7. #7
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Turn your list into an array easily with
    http://www.villavu.com/forum/showthr...?t=5442?t=6299

  8. #8
    Join Date
    Nov 2006
    Location
    Wisconsin
    Posts
    1,629
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Ok, now i am trying to apply this to the way i want to use this.

    SCAR Code:
    program spam;
    Begin
    Wait (1000);
    Wait (500);
    Clickmouse (71, 231, True);
    Wait (1000);
    Clickmouse (271, 254, True);
    Wait (100);
    Sendkeys ('blah blah blah');
    Wait (100);
    Clickmouse (267, 304, True);
    Wait (100);
    Sendkeys ('Hello');
    Wait (100)
    Clickmouse (250, 411, True);
    Wait (100);
    Sendkeys ('so on and so forth');
    Wait (100);
    Clickmouse (208, 668, True);
    Wait (1300);

    End.

    OK i want to take "blah blah blah" and make that say a list and pick like i asked. The other text stays the same.

    Now could i apply the previous things like this?

    SCAR Code:
    Program yeah;
    Begin
    Var
     Message: array [0..200] of String;
     f:integer;

    begin
     message[0]:='this';
     message[1]:='is';
     message[2]:='really';
     message[3]:='boring';
    //... all the way down to the last one.


    repeat
    Wait (1000);
    Wait (500);
    Clickmouse (71, 231, True);
    Wait (1000);
    Clickmouse (271, 254, True);
    Wait (100);
    for f:=0 to 200 do
         writeln(message[f]);
    Wait (100);
    Clickmouse (267, 304, True);
    Wait (100);
    Sendkeys ('Hello');
    Wait (100)
    Clickmouse (250, 411, True);
    Wait (100);
    Sendkeys ('this is my new program...');
    Wait (100);
    Clickmouse (208, 668, True);
    Wait (1300);
    until(false);
    end;

    End.

    Ok i get it i am new to scar but i am trying to learn. I know i am using very basic operations but i am not typing in Runescape so i dont need the undetectable operations.

    When i use this i get Line 3: [Error] (3:1): Identifier expected in script

    I am probably missing something big that i haven't figured out yet.

    I don't mean to be a leecher or a noob but i am trying to learn scar.

    Oh heck i might as well tell what i am trying to do with this. I am trying to create a basic email spamming operation for a project. This is to demonstrate how easy it is for someone to spam and do "illegal" operations. Yeah and this is for school and i am only in 8th grade.... Yeah i am in the advanced part of class for computers.

    Thanks for any help.

    Mr.klean

    (Oh and if anyone helps me and wants anything in return and they play rs, i could pay you some gold in rs for helping me)

  9. #9
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You need to declare your variables before the 'begin' So take away the first begin, and then take away one of the end;

    Also, you should probably add some movemouse procedures between the clickmouse, otherwise SCAR will try to click on coordinates that the mouse isn't actually at yet.

    SCAR Code:
    Program yeah;
    Var
     Message: array [0..200] of String;
     f:integer;

    begin
     message[0]:='this';
     message[1]:='is';
     message[2]:='really';
     message[3]:='boring';
    //... all the way down to the last one.


    repeat
    wait(5000);
    Wait (1000);
    Wait (500);
    Clickmouse (71, 231, True);
    Wait (1000);
    Clickmouse (271, 254, True);
    Wait (100);
    for f:=0 to 200 do
         writeln(message[f]);
    Wait (100);
    Clickmouse (267, 304, True);
    Wait (100);
    Sendkeys ('Hello');
    Wait (100)
    Clickmouse (250, 411, True);
    Wait (100);
    Sendkeys ('this is my new program...');
    Wait (100);
    Clickmouse (208, 668, True);
    Wait (1300);
    until(false);

    End.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Who is bored right know?
    By poopy2177 in forum NOTA
    Replies: 5
    Last Post: 01-11-2009, 10:31 PM
  2. I was bored...
    By MylesMadness in forum Semi Stupid Pictures
    Replies: 2
    Last Post: 05-08-2008, 05:18 AM
  3. If you are ever bored
    By knowmysteeez in forum News and General
    Replies: 7
    Last Post: 12-07-2007, 02:22 PM
  4. i'm bored...
    By ub3r |<1||3r*1337* in forum Blogs and Writing
    Replies: 0
    Last Post: 04-29-2006, 12:38 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
  •