Results 1 to 7 of 7

Thread: Tv's Staff Spell Selecter

  1. #1
    Join Date
    Aug 2007
    Location
    England
    Posts
    136
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Tv's Staff Spell Selecter

    Hey, I'm Currently Making a Mage Based Scipt, and Thus Came Across The Problem Of Selecting Which Spell To Use, So I Made This Procedure,

    Bassically It Picks The Best Spell Avaluable, It Only Works For Mages Whom, Use A Staff, But Lets Be Honest Most Mages Do.

    SCAR Code:
    Function WhichStaffSpell : String;
    Var
    SLX1, SLY1, SLX2, SLY2 : Integer;
    Tx, Ty, Px, Py : Integer;
    SpellChoice, Elemant, SpType : String;

    Begin
      SLX1 := 552;
      SLY1 := 268;
      SLX2 := 730;
      SLY2 := 288;
      GameTab(1);
      Mouse(656, 254, 50, 40, True);
      While FindColorTolerance(Tx, Ty, 1777020, 560, 222, 727, 423, 10) Do
        Wait(500);
      Repeat
        MMouse((705 - Px), (425 - Py), 4, 4)
        wait(200+random(100))
        If(Not(FindColorTolerance(Tx, Ty, 255, SLX1, SLY1, SLX2, SLY2, 5)))Then
        Begin
          Mouse((705 - Px), (425 - Py), 4, 4, True)
          Break;
        End Else
        Begin
          If(Px<110)Then
          Begin
            Px := Px + 40
          End Else
          Begin
           Px := 0;
           If(Py<170)Then
           Begin
             Py := Py + 60
           End Else
           Begin
             Writeln('Could Not Find Any Spells')
             Mouse(686, 450, 34, 7, True)
             Result := 'None'
             Exit;
           End;
          End;
          If(Py>100)Then
          Begin
            SLY1 := 443;
            SLY2 := 459;
          End;
        End;
      Until(False)
      If Px = 0 Then
        Elemant := 'Fire';
      If Px = 40 Then
        Elemant := 'Earth';
      If Px = 80 Then
        Elemant := 'Water';
      If Px = 120 Then
        Elemant := 'Wind';
      If Py = 0 Then
        SpType := 'Wave';
      If Py = 60 Then
        SpType := 'Blast';
      If Py = 120 Then
        SpType := 'Bolt';
      If Py = 180 Then
        SpType := 'Strike';
      SpellChoice :=  Elemant + ' ' + SpType
      Writeln('Picked Spell : ' + SpellChoice)
      Wait(1000+random(1000))
      Result := SpellChoice;
    End;

    And For Use I'd Do This

    SCAR Code:
    {.include Srl/Srl/Skill/Magic.scar}

    Cast(WhichStaffSpell)

    Cheers

    Tv.

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

    Default

    Px, Py Useless, you just wanna make it look professional

  3. #3
    Join Date
    Jan 2008
    Location
    Stanford, CA
    Posts
    329
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    Px, Py Useless, you just wanna make it look professional
    I concur, a lot of unnecessary things are occuring here that you only really add once into your script. Might cut down a few (very few at that) milliseconds, but it's not necessary. Like this...

    SCAR Code:
    SLX1 := 552;
      SLY1 := 268;
      SLX2 := 730;
      SLY2 := 288;

    Why didn't you just use coordinates for the ONE function you used these with? Your kinda defying the purpose of presetting coordinates.

    1: You made it longer to type out.

    2: You only used it once in the whole function!

    Standards look ok. Not sure how it compiles, but I'll be sure to try and work it later.

    Keep it up!

  4. #4
    Join Date
    Aug 2007
    Location
    England
    Posts
    136
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I Think You May Find That Without Px, Py, SLX1 Ect...It Wouldn't Work...

    Basically It Checks Wether You Have Enough Runes To Cast The Spell, So Px and Py, Are The Gaps Between Each Spell, and SlX1 ect... Is Where It Checks The Runes, The Values Of SLX1 Changes, Becouse Where It Should Be Looking Changes When You Get So Far Up The List.

    Test It and See.

    Yours Tv.

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

    Default

    Quote Originally Posted by freakymonkey View Post
    I concur, a lot of unnecessary things are occuring here that you only really add once into your script. Might cut down a few (very few at that) milliseconds, but it's not necessary. Like this...

    SCAR Code:
    SLX1 := 552;
      SLY1 := 268;
      SLX2 := 730;
      SLY2 := 288;

    Why didn't you just use coordinates for the ONE function you used these with? Your kinda defying the purpose of presetting coordinates.

    1: You made it longer to type out.

    2: You only used it once in the whole function!

    Standards look ok. Not sure how it compiles, but I'll be sure to try and work it later.

    Keep it up!
    you just gave him your middle finger

  6. #6
    Join Date
    Jan 2008
    Location
    Stanford, CA
    Posts
    329
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Sorry, Tv if I was kinda messed up. Rather unnecessary for me to do that :\.

    Forgive me? .

    However, I understand the "Px, Py" but, I still don't see why you need to do the SLX1, etc.

  7. #7
    Join Date
    Aug 2007
    Location
    England
    Posts
    136
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok freakymonkey I forgive you XD
    ok to try and explain the SLX1, firstly SLX1 stands for "Spell Location" X1, if you wield a staff then select to use cast (gametab(1)) you can then scan over each spell, when you do this a popup is made, showing which runes are needed and if you have enough runes, if you dont have enough runes, the text appears in red (color 255 i believe) but when you get to the bootem two rows of spells, the "Spell Location" changes, thus meaning SLX1 ect.... must change else the script will look for the color in the wrong place.

    I hope that explained it a little better.

    Yours Tv.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Tv's West Varrok Clay Miner and Softner - [BETA]
    By Tv-XxX in forum RS3 Outdated / Broken Scripts
    Replies: 34
    Last Post: 12-15-2008, 05:28 AM
  2. Read Me! Free for All | Only Staff can post in this section!
    By WT-Fakawi in forum RS3 Outdated / Broken Scripts
    Replies: 273
    Last Post: 01-01-2008, 05:40 PM
  3. What staff casts earth and water ?
    By Harry in forum RuneScape News and General
    Replies: 7
    Last Post: 11-13-2007, 07:56 AM
  4. HoverSpell; Antiban/Spell Casting/Spell checking function.
    By R0b0t1 in forum Research & Development Lounge
    Replies: 14
    Last Post: 08-17-2007, 05:36 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
  •