Results 1 to 9 of 9

Thread: Drop procedure and auto responder

  1. #1
    Join Date
    Jul 2007
    Location
    New Zealand FTW!
    Posts
    72
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Smile Drop procedure and auto responder

    hey guys, me again.

    I am now wanting to add dropping and autoresponder to my powercutt0rpl0x script. the script can be found at http://www.villavu.com/forum/showthread.php?t=47913

    For dropping i need to kno how i can add axeequipt=true/false to declare players and how i would make a drop procedure.

    For auto responder i have read some tuts however i want to make one where i set what phrases/words to respond to and what the response should be.

    Any help is much appreciated.

    ~brad
    The SRL team brings all the mods to the yard,
    And their like, "We kno u bot hard",
    "Damn right, We DO bot hard",
    "But you cant catch us, cos we use S.M.A.R.T!"

  2. #2
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    For the axe equipped bit, just add this to the player in DeclarePlayers:
    SCAR Code:
    Players[0].Booleans[0] := False; //Axe equipped?
    Or just make a function that auto-detects it (that'd be a bit harder).

    SCAR Code:
    Procedure DropLogs;
    Var
      i : Integer;
    Begin
      For i := (Integer(Not(Players[CurrentPlayer].Booleans[0])) + 1) To 28 Do
        DropItem(i);
    End;

    It might sound kinda difficult, i'll explain:
    Integer(); makes an integer of the boolean (true = 1, false = 0)
    Not sort of makes it that true = 0 and false = 1
    Players[CurrentPlayer].Booleans[0] is just the axe equipped boolean in DeclarePlayers
    We NEED the +1, else it will try to start dropping from slot 0 when the axe is equipped, or it will drop the axe if it is not equipped. So the +1 makes true = 1 and false = 2.
    Ce ne sont que des gueux


  3. #3
    Join Date
    Jul 2007
    Location
    New Zealand FTW!
    Posts
    72
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You are the man ty a bunch. onto my creditz list you go.

    Now leave only one problem. my auto responder
    The SRL team brings all the mods to the yard,
    And their like, "We kno u bot hard",
    "Damn right, We DO bot hard",
    "But you cant catch us, cos we use S.M.A.R.T!"

  4. #4
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    I'm sorry, but I've never used autoresponders before, but I gave it a shot:
    SCAR Code:
    Procedure ARespond;
    Var
      WCLvl, i : Integer;
      Finds, Responds, Chats : TStringArray;
    Begin
      WCLvl := GetSkillLevel('woodcutting'); //Get WC level
      Finds := ['wc lvl', 'lvl', 'wc', 'woodcutting level', 'level']; //What to search for in chat
      SetLength(Responds, Length(Finds)); //Make length of searches & responds the same
      For i := 0 To 7 Do
        Chats[i] := GetChatBoxText(i, clBlue); //Get all chat box text
      For i := 0 To High(Responds) Do
      Begin
        Responds[i] := IntToStr(WCLvl); //Set the responds to say current WC lvl
        If Pos(Finds[i], Chats[i]) > 0 Then //If one of the searches is found in the chat box,
          TypeSend(Responds[i]);            //type a response
      End;
    End;

    Haven't tested it at all :/
    Ce ne sont que des gueux


  5. #5
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Floor66 View Post
    For the axe equipped bit, just add this to the player in DeclarePlayers:
    SCAR Code:
    Players[0].Booleans[0] := False; //Axe equipped?
    Or just make a function that auto-detects it (that'd be a bit harder).

    SCAR Code:
    Procedure DropLogs;
    Var
      i : Integer;
    Begin
      For i := (Integer(Not(Players[CurrentPlayer].Booleans[0])) + 1) To 28 Do
        DropItem(i);
    End;

    It might sound kinda difficult, i'll explain:
    Integer(); makes an integer of the boolean (true = 1, false = 0)
    Not sort of makes it that true = 0 and false = 1
    Players[CurrentPlayer].Booleans[0] is just the axe equipped boolean in DeclarePlayers
    We NEED the +1, else it will try to start dropping from slot 0 when the axe is equipped, or it will drop the axe if it is not equipped. So the +1 makes true = 1 and false = 2.
    And if he has the axe in a different location, it screws it up .

  6. #6
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    What you mean by 'different location'?
    Like different inv. slot? Nobody has that
    This is just a basic way around the axe equipped thing. I'd auto detect it anyway.
    Ce ne sont que des gueux


  7. #7
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, I mean a different inventory slot .

  8. #8
    Join Date
    Jul 2007
    Location
    New Zealand FTW!
    Posts
    72
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    the auto responder doesnt work. gets this error

    Code:
    [Runtime Error] : Out Of Range in line 135 in script C:\Documents and Settings\Owner\Desktop\powercutt0rpl0xrevisedV1.4.scar
    Line 135 in your aresponder procedure

    Code:
    Procedure ARespond;
    Var
      WCLvl, i : Integer;
      Finds, Responds, Chats : TStringArray;
    Begin
      WCLvl := GetSkillLevel('woodcutting'); //Get WC level
      Finds := ['wc lvl', 'lvl', 'wc', 'woodcutting level', 'level']; //What to search for in chat
      SetLength(Responds, Length(Finds)); //Make length of searches & responds the same
      For i := 0 To 7 Do
        Chats[i] := GetChatBoxText(i, clBlue); //Get all chat box text
      For i := 0 To High(Responds) Do
      Begin
        Responds[i] := IntToStr(WCLvl); //Set the responds to say current WC lvl
        If Pos(Finds[i], Chats[i]) > 0 Then //If one of the searches is found in the chat box,
          TypeSend(Responds[i]);            //type a response
      End;
    End;
    is this line.

    Code:
     Chats[i] := GetChatBoxText(i, clBlue); //Get all chat box text
    i kno u said it might not work but i thought id let you know
    The SRL team brings all the mods to the yard,
    And their like, "We kno u bot hard",
    "Damn right, We DO bot hard",
    "But you cant catch us, cos we use S.M.A.R.T!"

  9. #9
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    SCAR Code:
    Procedure ARespond;
    Var
      WCLvl, i : Integer;
      Finds, Responds : TStringArray;
      Chats : Array [1..8] Of String;
    Begin
      WCLvl := GetSkillLevel('woodcutting'); //Get WC level
      Finds := ['wc lvl', 'lvl', 'wc', 'woodcutting level', 'level']; //What to search for in chat
      SetLength(Responds, Length(Finds)); //Make length of searches & responds the same
      For i := 1 To 8 Do
        Chats[i] := GetChatBoxText(i, clBlue); //Get all chat box text
      For i := 0 To High(Responds) Do
      Begin
        Responds[i] := IntToStr(WCLvl); //Set the responds to say current WC lvl
        If Pos(Finds[i], Chats[i]) > 0 Then //If one of the searches is found in the chat box,
          TypeSend(Responds[i]);            //type a response
      End;
    End;

    Try that.
    Ce ne sont que des gueux


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
  •