Results 1 to 8 of 8

Thread: PLz Help this noob!

  1. #1
    Join Date
    Jun 2007
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default PLz Help this noob!

    Code:
    Procedure Click;
    Var
    BC, PDTM :Integer;
    begin
      PDTM := DTMFromString('78DA639CC6C4C0F088010D30814946288FB11' +
           '3C87F4840CD5420FF3601358B80FC2704D44C06F2DF12503317C8' +
           'BF4F40CD0420FF297E3500B6C20A74');
    BC := FindDTM(PDTM, x, y, MIX1, MIY1, MIX2, MIY2);
    MouseBox((BC - 15), (BC - 7), (BC + 17), (BC + 17), 1)
    FreeDTM(PDTM);
    end;

    I get this annoying [Error] (21276:53): Type mismatch in script
    no idea what i'm doing wrong

  2. #2
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Change BC to a Boolean.

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  3. #3
    Join Date
    Jun 2007
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Dont think the Boolean works with the math in the Mousebox
    Can FindDTM be an Integer? (like gives coordinates x, y of where it is found?)

    lol nvm think i got it xD

    Code:
    Procedure Click;
    Var
    Bx, By, PDTM :Integer;
    
    begin
      PDTM := DTMFromString('78DA639CC6C4C0F088010D30814946288FB11' +
           '3C87F4840CD5420FF3601358B80FC2704D44C06F2DF12503317C8' +
           'BF4F40CD0420FF297E3500B6C20A74');
    FindDTM(BoneDTM, Bx, By, MIX1, MIY1, MIX2, MIY2);
    MouseBox((Bx - 15), (By - 7), (Bx + 17), (By + 17), 1)
    FreeDTM(PDTM);
    end;
    I think lol
    thanks for Brainstorming with me =]
    Last edited by Farts; 01-03-2010 at 04:50 PM.

  4. #4
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Just as a little note, you probably want "if FindDTM then MouseBox" otherwise it will click regardless of whether or not it found it, which could cause an annoying problem for you later on.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  5. #5
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Farts View Post
    Dont think the Boolean works with the math in the Mousebox
    Can FindDTM be an Integer? (like gives coordinates x, y of where it is found?)

    lol nvm think i got it xD

    Code:
    Procedure Click;
    Var
    Bx, By, PDTM :Integer;
    
    begin
      PDTM := DTMFromString('78DA639CC6C4C0F088010D30814946288FB11' +
           '3C87F4840CD5420FF3601358B80FC2704D44C06F2DF12503317C8' +
           'BF4F40CD0420FF297E3500B6C20A74');
    FindDTM(BoneDTM, Bx, By, MIX1, MIY1, MIX2, MIY2);
    MouseBox((Bx - 15), (By - 7), (Bx + 17), (By + 17), 1)
    FreeDTM(PDTM);
    end;
    I think lol
    thanks for Brainstorming with me =]
    I'm a little rusty.. But shouldn't that be..something like this?

    SCAR Code:
    Function Click: Boolean;
    Var
      Bx, By, PDTM: Integer;

    begin
      PDTM := DTMFromString('78DA639CC6C4C0F088010D30814946288FB11' +
           '3C87F4840CD5420FF3601358B80FC2704D44C06F2DF12503317C8' +
           'BF4F40CD0420FF297E3500B6C20A74'); //Load the DTM
      Result := FindDTM(PDTM, Bx, By, MIX1, MIY1, MIX2, MIY2); //Attempt to find the DTM, return True if found, False if not.
      if (Result) then //Checks the Result variable (if it is true)
    //Also, I changed BoneDTM to PDTM, because I'm guessing that you mistyped that, plus I see no reason in declaring that DTM unless that's the one your searching for.
        MouseBox((Bx - 15), (By - 7), (Bx + 17), (By + 17), 1) //if its true, MouseBox
      else begin //Else (if its false)
        FreeDTM(PDTM); //Free the DTM
        Exit; //Exit Function
      end;
      FreeDTM(PDTM); //Free DTM if the statement was true.
    end;
    Because what happens if the finding of that DTM fails? I'm sure that would cause some kind of Runtime error, or just click a random spot and change tabs / move. Also, by changing that procedure to a function, you can use that function to detect if your out of bones, no?
    -- that Result doesn't have to be called as Result: Boolean;, because in a function the Result variable modifies what the function returns.

    SCAR Code:
    if (not Click) then
        if (not Click) then
          Exit; //Exit the bury procedure and go to the banking?  Instead of calling a check after every bone (if that is what you're doing).

    EDIT: mixster kinda beat me too it.
    Last edited by Timer; 01-03-2010 at 05:14 PM. Reason: mixster D:<

  6. #6
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    you wouldn't have to do the else bit as all you are doing by doing that is freeing the DTM then quitting the function and so you only avoid the DTM freeing bit, but you don't need to avoid it if you don't free it in the else bit. Basically, just remove the else begin FreeDTM(); Exit; end; bit and it still works the same, just in functiony form.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  7. #7
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mixster View Post
    you wouldn't have to do the else bit as all you are doing by doing that is freeing the DTM then quitting the function and so you only avoid the DTM freeing bit, but you don't need to avoid it if you don't free it in the else bit. Basically, just remove the else begin FreeDTM(); Exit; end; bit and it still works the same, just in functiony form.
    True dat. -makes up random excuse- But what if he adds more to that function? ehh?

    Quote Originally Posted by Timer
    I'm a little rusty..

  8. #8
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    SCAR Code:
    Function Click: Boolean;
    Var
      Bx, By, PDTM: Integer;

    begin
      PDTM := DTMFromString('78DA639CC6C4C0F088010D30814946288FB11' +
           '3C87F4840CD5420FF3601358B80FC2704D44C06F2DF12503317C8' +
           'BF4F40CD0420FF297E3500B6C20A74');
      Result := FindDTM(PDTM, Bx, By, MIX1, MIY1, MIX2, MIY2);
      freedtm(PDTM);
      if (not result) then exit;
      MouseBox((Bx - 15), (By - 7), (Bx + 17), (By + 17), 1);
    end;
    Maybe liek that ?
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

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
  •