Results 1 to 5 of 5

Thread: QCSkillLevel(Skill:String):Boolean;

  1. #1
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default QCSkillLevel(Skill:String):Boolean;

    This took me a long time to write, so a push would be nice
    I can't access the GIT at school so I can't request it :l.
    Also, I do not know the byte code for 'Enter' so please replace the variable K with the byte code.

    Simba Code:
    Function QCSkillLevel(Skill:String):boolean;
    var
      k:Integer;
    begin
    k := 0; //code for 'Enter'
      case Lowercase(skill) of
        'Attack':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('g',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Strength':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('g',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Defence':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('d',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Hitpoints':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('l',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Agility':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('a',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Magic':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('m',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Cooking':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('v',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Firemaking':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('p',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Mining':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('i',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Smithing':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('b',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Fishing':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('w',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Ranged':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('r',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Prayer':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('y',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Runecraft':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('n',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Dungeoneering':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('f',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Construction':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('c',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Fletching':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('e',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Slayer':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Hunter':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('u',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Farming':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('q',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Thieving':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('t',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Crafting':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('x',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Woodcutting':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('j',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Summoning':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('o',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
        'Herblore':
        begin
          TypeByte(k);
          TypeSendEx('s',False);
          Wait(100 + random(50));
          TypeSendEx('h',False);
          Wait(100 + random(50));
          TypeSendEx('2',False);
        end;
    Result := True;
    end;

    Tbh, I think it's kinda sad, I typed all the QC codes out via memory

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

    Default

    I think there's a bug in there; both Attack and Strength have the same character (g)

    Also, all that repetitive code can be shortened using an array:
    Simba Code:
    procedure QC_SaySkillLevel(const Skill : Integer);
    var
      skill_Arr : String;
    begin
      if not InRange(Skill, SKILL_ATTACK, SKILL_DUNGEONEERING) then Exit;

      skill_Arr := 'ggdlamvpibwrynfcesuqtxjoh';

      TypeSendEx('', True); //Enter
      TypeSendEx('s', False);
      Wait(100 + Random(50));
      TypeSendEx(skill_Arr[Skill], False);
      Wait(100 + Random(50));
      TypeSendEx('2', False);
    end;
    I haven't tested it, and the characters (ggdlamvpibwrynfcesuqtxjoh) are from the original function, so attack and strength will say the same level, but I just wanted to show how this function could be shortened a lot

  3. #3
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    I think there's a bug in there; both Attack and Strength have the same character (g)

    Also, all that repetitive code can be shortened using an array:
    Simba Code:
    procedure QC_SaySkillLevel(const Skill : Integer);
    var
      skill_Arr : String;
    begin
      if not InRange(Skill, SKILL_ATTACK, SKILL_DUNGEONEERING) then Exit;

      skill_Arr := 'ggdlamvpibwrynfcesuqtxjoh';

      TypeSendEx('', True); //Enter
      TypeSendEx('s', False);
      Wait(100 + Random(50));
      TypeSendEx(skill_Arr[Skill], False);
      Wait(100 + Random(50));
      TypeSendEx('2', False);
    end;
    I haven't tested it, and the characters (ggdlamvpibwrynfcesuqtxjoh) are from the original function, so attack and strength will say the same level, but I just wanted to show how this function could be shortened a lot
    Progress Report:
    Quick Chat -> Skills ->
    
    A. Agility
    Z. Attack
    L. Constitution
    C. Construction
    V. Cooking
    X. Crafting
    D. Defence
    F. Dungeoneering (lol eff" Dg'ing)
    Q. Farming
    P. Firemaking
    W. Fishing
    E. Fletching
    H. Herblore
    U. Hunter
    M. Magic
    I. Mining
    Y. Prayer
    R. Ranged
    N. Runecrafting
    S. Slayer
    B. Smithing
    G. Strength
    O. Summoning
    T. Thieving
    J. Woodcutting


    * That list, following that ^ order, results;
    Progress Report:
    azlcvxdfqpwehumiyrnsbgotj


    * Or if you want in re-arranged in the way OP(s1) posted;
    Progress Report:
    zgdlamvpibwrynfcesuqtxjoh


    *** Tested the quoted proc via Zyt3x, along with the re-done letters I posted, works great.

    Simba Code:
    {
    Ex.
    }

    QC_SaySkillLevel(1); // Results me qc'ing my att lvl. :>

  4. #4
    Join Date
    Dec 2009
    Location
    R_GetPlayerLoc;
    Posts
    2,235
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    Progress Report:
    Quick Chat -> Skills ->
    
    A. Agility
    Z. Attack
    L. Constitution
    C. Construction
    V. Cooking
    X. Crafting
    D. Defence
    F. Dungeoneering (lol eff" Dg'ing)
    Q. Farming
    P. Firemaking
    W. Fishing
    E. Fletching
    H. Herblore
    U. Hunter
    M. Magic
    I. Mining
    Y. Prayer
    R. Ranged
    N. Runecrafting
    S. Slayer
    B. Smithing
    G. Strength
    O. Summoning
    T. Thieving
    J. Woodcutting


    * That list, following that ^ order, results;
    Progress Report:
    azlcvxdfqpwehumiyrnsbgotj


    * Or if you want in re-arranged in the way OP(s1) posted;
    Progress Report:
    zgdlamvpibwrynfcesuqtxjoh


    *** Tested the quoted proc via Zyt3x, along with the re-done letters I posted, works great.

    Simba Code:
    {
    Ex.
    }

    QC_SaySkillLevel(1); // Results me qc'ing my att lvl. :>
    I think the order they posted makes special use of the constants in SRL...
    "Logic never changes, just the syntax" - Kyle Undefined?

    Remember, The Edit Button Is There For A Reason!!!

  5. #5
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Simba Code:
    {$i SRL/SRL/misc/quickchat.simba}

    Simba Code:
    {*******************************************************************************
    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';
        'herblore', '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;

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
  •