Poll: Should this be added to SRL?

Be advised that this is a public poll: other users can see the choice(s) you selected.

Results 1 to 21 of 21

Thread: QC.scar! QuickChat functions!

  1. #1
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default QC.scar! QuickChat functions!

    Well, I hope this is the right section.

    SCAR Code:
    //-----------------------------------------------------------------//
    //--               Scar Standard Resource Library                --//
    //--                  » QuickChat procedures                     --//
    //-----------------------------------------------------------------//

    // » function QCOpen: Boolean;                                    | by EvilChicken!
    // » procedure OpenQC;                                            | by EvilChicken!
    // » procedure CloseQC;                                           | by EvilChicken!
    // » procedure QCOpenMenu(Menu: string; SubMenus: array of Char); | by EvilChicken!                                      
    // » procedure QCSayLevel;                                        | by EvilChicken!

    {*******************************************************************************
    function QCOpen: Boolean;
    By: EvilChicken!
    Description: Returns true/false depending on if QuickChat window is open.
    *******************************************************************************}

    function QCOpen: Boolean;
    begin
      Result := (GetColor(37, 352) = 14869218) and LoggedIn;
    end;
     
    {*******************************************************************************
    procedure OpenQC;
    By: EvilChicken!
    Description: Opens QuickChat window if it isn't open.
    *******************************************************************************}

    procedure OpenQC;
    begin
      if not LoggedIn or QCOpen then exit;
      while CountColor(16711680, 6, 460, 512, 474) > 14 do
        TypeByte(08);
      if random(2) = 0 then
      TypeByte(Chr(13)) else
      MouseBox(12, 462, 72, 471, 1);
      Wait(150 + random(85));
    end;

    {*******************************************************************************
    procedure CloseQC;
    By: EvilChicken!
    Description: Closes QuickChat window if it is open.
    *******************************************************************************}

    procedure CloseQC;
    begin
      if (not LoggedIn) or (not QCOpen) then exit;
      if random(2) = 0 then MouseBox(9, 348, 20, 358, 1) else
        TypeByte(27);
      Wait(150 + random(85));
    end;

    {*******************************************************************************
    procedure QCOpenTab(Tab: string; SubTabs: array of Char);
    By: EvilChicken!
    Description: Opens QuckChat, clicks 'Menu' menu, then uses 'SubMenus' chars to
    open submenus. 'Menu' options: 'general', 'trade', 'skill', group', 'clan'.
    Use: QCOpenMeny('Trade', ['a', 'b', 'c']);
    *******************************************************************************}

    procedure QCOpenMenu(Menu: string; SubMenus: array of Char);
    var
      I: Integer;
     
    begin
      if not LoggedIn then Exit;
      if QCOpen then
      begin
        CloseQC;
        Wait(500 + random(1500));
      end;
      OpenQC;
      case LowerCase(Menu) of
        'general': if random(2) = 0 then
          MouseBox(12, 363, 98, 373, 1) else TypeByte(GetKeyCode('g'));
        'trade', 'items': if random(2) = 0 then
          MouseBox(12, 377, 115, 385, 1) else TypeByte(GetKeyCode('t'));
        'skill', 'skills': if random(2) = 0 then
          MouseBox(12, 392, 113, 402, 1) else TypeByte(GetKeyCode('s'));
        'group', 'event', 'events', 'group events': if random(2) = 0 then
          MouseBox(12, 407, 110, 412, 1) else TypeByte(GetKeyCode('e'));
        'clan', 'clans': if random(2) = 0 then
          MouseBox(12, 420, 115, 429, 1) else TypeByte(GetKeyCode('c'));
      else
        begin
          srl_Warn('QCOpenMenu', Menu + ' is an invalid QC menu ', warn_AllVersions);
          Exit;
        end;
      end;
      Wait(350 + random(250));
      if GetArrayLength(SubMenus) > 0 then
        for I := 0 to High(SubMenus) do
        begin
          TypeByte(GetKeyCode(SubMenus[I]));
          Wait(1350 + random(500));
        end;
    end;

    {*******************************************************************************
    procedure QCSayLevel(Which: string);
    By: EvilChicken!
    Description: Says 'Which' skill level using Quick Chat.
    *******************************************************************************}

    procedure QCSayLevel(Which: string);
    var
      Skill: Char;
     
    begin
      case LowerCase(Which) of
        'agility', 'agil': Skill := 'a';
        'attack', 'atk': Skill := 'z';
        'construction', 'con': Skill := 'c';
        'cooking', 'cook': Skill := 'v';
        'crafting': Skill := 'x';
        'defence', 'def': Skill := 'd';
        'farming', 'farm': Skill := 'f';
        'firemaking', 'fm': Skill := 'p';
        'fishing': Skill := 'w';
        'fletching', 'fletch': Skill := 'e';
        'helblore', 'herb': Skill := 'h';
        'hitpoints', 'hp': Skill := 'l';
        'hunting', 'hunter': Skill := 'u';
        'magic', 'mage': Skill := 'm';
        'mining': Skill := 'i';
        'prayer', 'pray': Skill := 'y';
        'range', 'ranged': Skill := 'r';
        'runecrafting', 'rc': Skill := 'n';
        'slayer': Skill := 's';
        'smith', 'smithing': Skill := 'b';
        'strength', 'str': Skill := 'g';
        'summoning', 'sum': Skill := 'o';
        'thieving', 'thief': Skill := 't';
        'woodcutting', 'wc': Skill := 'j';
      else
        begin
          srl_Warn('QCSayLevel', Which + ' is an invalid skill ', warn_AllVersions);
          Exit;
        end;
      end;
      QCOpenMenu('skills', [Skill, '2']);
    end;


    Lemme know what you think. ^^

    Edit: The way QCOpenMenu works:
    1: Type "QCOpenMenu(".
    2: Type in one of these main tabs: 'Menu' options: 'general', 'trade', 'skill', group', 'clan'.
    3: Type a comma! (",")
    4: Type in a left bracket! ("[")
    5: Type in the array of chars for the subtabs you want to go to. As strings! For example to say your woodcutting level, you would have to use nothing more than: QCOpenMenu('skills', ['j', '2']);

    To see a chart of chars for the skills, have a look at QCSayLevel. (Which by th way took a long time to make. I hope you keep that in mind. )

  2. #2
    Join Date
    Dec 2006
    Location
    utah
    Posts
    1,427
    Mentioned
    2 Post(s)
    Quoted
    7 Post(s)

    Default

    this is pretty cool
    Co Founder of https://www.tagcandy.com

  3. #3
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    pretty cool
    ~Hermen

  4. #4
    Join Date
    Mar 2007
    Location
    <3
    Posts
    2,683
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Should be added! looks great

  5. #5
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice looks very sexy and would be very usefu!
    Extinct.

    Formally known as Drags111.

  6. #6
    Join Date
    May 2007
    Location
    Ontario
    Posts
    361
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I like it, but I think it should open QC with the enter key. Of course after checking if anything has been typed.

    Edit: I think you should also make it so people can type in just the letter they want instead of just the skill name and there should be a little guide to the names of the skills like here:

    http://www.villavu.com/forum/showthread.php?t=30770

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

    Default

    Well written, but IMO SRL doesn't need them.
    Interested in C# and Electrical Engineering? This might interest you.

  8. #8
    Join Date
    May 2007
    Location
    Ontario
    Posts
    361
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Smartzkid View Post
    Well written, but IMO SRL doesn't need them.
    It could still be helpful though, now you can use less time in typing out the reply and clicking stats/clicking back to the inventory. It's an overall faster way to do things in my eyes and I think it would be a great addition to SRL - Provided that a few changes be made to make it as fast as possible.

  9. #9
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    You should add a Random2 := Random(2) in the start, so that it either clicks whole the time or types chars whole the time. Like it is now it will (maybe) click, type, click, type.

    And then say If Random2 = 0 instead of if Random(2) = 0. You get my point?

  10. #10
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Smartzkid View Post
    Well written, but IMO SRL doesn't need them.
    Why not? Post your opinions? Thank you for your input anyway.

    Quote Originally Posted by TheGuyWhoGotOn View Post
    I like it, but I think it should open QC with the enter key. Of course after checking if anything has been typed.
    DONE! Thank you for your suggestion. And, you should yeplace your with mine, SendKeysVB is detectable IMO. (Kinda the same as SendText..?)

    Quote Originally Posted by TheGuyWhoGotOn View Post
    Edit: I think you should also make it so people can type in just the letter they want instead of just the skill name and there should be a little guide to the names of the skills like here:

    http://www.villavu.com/forum/showthread.php?t=30770
    ..

    As you see, my function can be used to press as many keys as you want.
    (Use: OpenQCMenu('general', ['d', '2', ect..]).

    Just input an array of chars and it will go to the tabs and subtabs for you.
    Take a look at QCSayLevel for an example.

    Quote Originally Posted by TheGuyWhoGotOn View Post
    It could still be helpful though, now you can use less time in typing out the reply and clicking stats/clicking back to the inventory. It's an overall faster way to do things in my eyes and I think it would be a great addition to SRL - Provided that a few changes be made to make it as fast as possible.
    Thanks a lot for your long, informational comment!
    (*cough* Hermpie *cough*)


    oh and Sky your so cool.. i love you!!!

    Quote Originally Posted by Zytex! View Post
    You should add a Random2 := Random(2) in the start, so that it either clicks whole the time or types chars whole the time. Like it is now it will (maybe) click, type, click, type.

    And then say If Random2 = 0 instead of if Random(2) = 0. You get my point?
    I WAS going to do that, but then I realized that getting all the coords for the MouseBox'es would take even more time than getting the letters to the tabs&subtabs. (And that took a while, trust me.)
    And I don't think anything's wrong with using the keys, it IS a much faster way in my opinion, but I can understand that you want to vary it, and I'll try my best to do so.

    Takk.


    Edit: I updated OpenQC again. Now it deletes any typed text that isn't sent in the chat window. ^^

  11. #11
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Just for your interest, array of char = string
    I made a new script, check it out!.

  12. #12
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Yeah we actually really need this, we must always be in line with all developments. Most of the Players now chat like this which makes it much easier to make an autoresponder


    Good Job EC!

  13. #13
    Join Date
    May 2007
    Location
    Ontario
    Posts
    361
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by EvilChicken! View Post
    Why not? Post your opinions? Thank you for your input anyway.


    DONE! Thank you for your suggestion. And, you should yeplace your with mine, SendKeysVB is detectable IMO. (Kinda the same as SendText..?)



    ..

    As you see, my function can be used to press as many keys as you want.
    (Use: OpenQCMenu('general', ['d', '2', ect..]).

    Just input an array of chars and it will go to the tabs and subtabs for you.
    Take a look at QCSayLevel for an example.



    Thanks a lot for your long, informational comment!
    (*cough* SkY/Hermpie *cough*)



    I WAS going to do that, but then I realized that getting all the coords for the MouseBox'es would take even more time than getting the letters to the tabs&subtabs. (And that took a while, trust me.)
    And I don't think anything's wrong with using the keys, it IS a much faster way in my opinion, but I can understand that you want to vary it, and I'll try my best to do so.

    Takk.


    Edit: I updated OpenQC again. Now it deletes any typed text that isn't sent in the chat window. ^^
    I'm glad I could help ^_^, voted yes.

  14. #14
    Join Date
    Nov 2007
    Location
    The Netherlands
    Posts
    1,490
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    it seems really cool..
    IMO... it is good to add in srl for responding
    i'll vote yes

  15. #15
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Few things:
    1.
    if not LoggedIn then Exit;
    Result := GetColor(37, 352) = 14869218;
    Change that too
    result := (GetColor(37, 352) = 14869218) and (LoggedIn);
    2. TypeByte(GetKeyCode(Chr(13))) = TypeByte(chr(13));

    Fix above stuff, maybe add some more functions and I'll add it to /misc/
    I made a new script, check it out!.

  16. #16
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Should have something like this in there:

    SCAR Code:
    Function QCFast(str:string):boolean;
    var
      i:integer;
      S:string;
    begin
      TypeByte(GetKeyCode(Chr(13)))
      wait(300+random(50));
      If QCOpen then
      begin
        S:=str;
        for i := 0 to Length(S) do
        begin
          TypeSend(S[i]);
          wait(150+random(50));
        end;
      end;
      if not QCOpen then
        Result := true;
    end;

    That way we can just have like "QCFast('gr2');" which is quick chats "No."

    Edit: Just fyi, I typed this up as an example. I haven't tested to see if works.

    Edit2: Or you could simply have TypeSend(str); in that procedure, since TypeSend actually delays key pressing... It just pushes enter after words but it wouldn't do anything then.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  17. #17
    Join Date
    May 2007
    Location
    Ontario
    Posts
    361
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Narcle View Post
    Should have something like this in there:

    SCAR Code:
    Function QCFast(str:string):boolean;
    var
      i:integer;
      S:string;
    begin
      TypeByte(GetKeyCode(Chr(13)))
      wait(300+random(50));
      If QCOpen then
      begin
        S:=str;
        for i := 0 to Length(S) do
        begin
          TypeSend(S[i]);
          wait(150+random(50));
        end;
      end;
      if not QCOpen then
        Result := true;
    end;

    That way we can just have like "QCFast('gr2');" which is quick chats "No."

    Edit: Just fyi, I typed this up as an example. I haven't tested to see if works.

    Edit2: Or you could simply have TypeSend(str); in that procedure, since TypeSend actually delays key pressing... It just pushes enter after words but it wouldn't do anything then.
    Pressing enter would re-open quick chat.

  18. #18
    Join Date
    Dec 2006
    Location
    utah
    Posts
    1,427
    Mentioned
    2 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by EvilChicken! View Post

    Thanks a lot for your long, informational comment!
    (*cough* Hermpie *cough*)


    oh and Sky your so cool.. i love you!!!

    uhmmm thanks?? im sorry... im not really into.. gayness.. but thanks anyway.
    Co Founder of https://www.tagcandy.com

  19. #19
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by SKy Scripter View Post
    uhmmm thanks?? im sorry... im not really into.. gayness.. but thanks anyway.
    Really? *disappointment*


    Looks awesum EvilChicken! I was gonna make one, but looks like you beat me to it


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  20. #20
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Markus View Post
    Few things:
    1.
    if not LoggedIn then Exit;
    Result := GetColor(37, 352) = 14869218;
    Change that too
    result := (GetColor(37, 352) = 14869218) and (LoggedIn);
    2. TypeByte(GetKeyCode(Chr(13))) = TypeByte(chr(13));

    Fix above stuff, maybe add some more functions and I'll add it to /misc/

    Done. Huge thanks! Woot, my own include?

    Quote Originally Posted by Narcle
    Or you could simply have TypeSend(str); in that procedure, since TypeSend actually delays key pressing... It just pushes enter after words but it wouldn't do anything then.
    Thanks for your function, I also though of it, but I like mine better somehow.
    And, TypeSend is too fast, and as someone also said, it opens up QC again.

  21. #21
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by EvilChicken! View Post
    Done. Huge thanks! Woot, my own include?



    Thanks for your function, I also though of it, but I like mine better somehow.
    And, TypeSend is too fast, and as someone also said, it opens up QC again.
    Yeah you could make a custom one just for it. It would be way faster then current method.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. A few SCAR functions...
    By Nose Smasher in forum OSR Help
    Replies: 0
    Last Post: 11-02-2008, 07:44 PM
  2. QuickChat Include
    By Dusk412 in forum Research & Development Lounge
    Replies: 4
    Last Post: 05-22-2008, 09:43 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
  •