Results 1 to 23 of 23

Thread: DTM help!

  1. #1
    Join Date
    Jan 2012
    Posts
    468
    Mentioned
    3 Post(s)
    Quoted
    200 Post(s)

    Default DTM help!

    Simba Code:
    Procedure FindLantern;

    Var
     X, Y, LanternDTM, 1:Integer;
     SlotBox:Tbox;

     Begin
        LanternDTM := DTMFromString('mrAAAAHic42BgYHBmYmBwAmIvIPYGYg8gtgJiCyj9HKjmBhDfA+JXQPwRil8C8UMgdopZAiSZ4FhaSoqBmUsKzv/FgB8wEsAwAACuKwwe');

        Begin
          FindNormalRandoms;
          SlotBox:=InvBox(1);
          If FindDTM(LanternDtm, X, Y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
          Begin
            MouseItem(1 ,2);
            ChooseOption('Use');
          End;
        End;
    End;

    kk! really need someone to tell me what im doing wrong!

  2. #2
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    try this:
    Simba Code:
    Procedure FindLantern;
    Var
     X, Y, LanternDTM:Integer;
     SlotBox:Tbox;
    Begin
      FindNormalRandoms;
      LanternDTM := DTMFromString('mrAAAAHic42BgYHBmYmBwAmIvIPYGYg8gtgJiCyj9HKjmBhDfA+JXQPwRil8C8UMgdopZAiSZ4FhaSoqBmUsKzv/FgB8wEsAwAACuKwwe');

      If FindDTM(LanternDtm, X, Y, MIX1, MIY1, MIX2, MIY2) Then
      Begin
        writeln('found DTM');
        Mouse(x,y,3,3,mouse_right);
        wait(200+random(200));
        ChooseOption('Use');
      End else
        writeln('did not find DTM');
      freeDTM(LanternDTM);
    End;

    wat does it say in the debug

  3. #3
    Join Date
    Jan 2012
    Posts
    468
    Mentioned
    3 Post(s)
    Quoted
    200 Post(s)

    Default

    [Error] (166:20): Identifier expected at line 165
    [Hint] (166:2): Variable '1' never used at line 165
    Compiled successfully in 1123 ms.

  4. #4
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    lol like a few secs after i posted that, i found that error
    i already edited the code above. use that code

  5. #5
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    SlotBox:=InvBox(1);
    So ur lantern is in the first inventory slot?
    Then why not just use InvMouse(1,2)?
    then maybe do a waituptext check to be safe.

  6. #6
    Join Date
    Jan 2012
    Posts
    468
    Mentioned
    3 Post(s)
    Quoted
    200 Post(s)

    Default

    Thanks to Warrior it works!

    But for some reason after it uses the lamp it stops the script!

    Heres the code that follows!
    Simba Code:
    Procedure FindLantern;
    Var
     X, Y, LanternDTM:Integer;
     SlotBox:Tbox;
    Begin
      FindNormalRandoms;
      LanternDTM := DTMFromString('mrAAAAHic42BgYHBmYmBwAmIvIPYGYg8gtgJiCyj9HKjmBhDfA+JXQPwRil8C8UMgdopZAiSZ4FhaSoqBmUsKzv/FgB8wEsAwAACuKwwe');

      If FindDTM(LanternDtm, X, Y, MIX1, MIY1, MIX2, MIY2) Then
      Begin
        writeln('found DTM');
        Mouse(x,y,3,3,mouse_right);
        wait(200+random(200));
        ChooseOption('Use');
      End else
        writeln('did not find DTM');
      freeDTM(LanternDTM);
    End;

    Procedure UseonLight;

    Var
    gX, gY: Integer;

    Begin
      Wait(1000);
      if FindColorSpiralTolerance(gX, gY, 8871996, 113, 3, 340, 89, 25)Then
      Begin
        WriteLn('Found Light');
        Wait(500);
        MMouse(gX,gY,5,5);
        wait(RandomRange(1000,2000));
        ClickMouse2(False);
        Wait(RandomRange(1000,1500));
        WaitOption('se Sap', 500);
        end;
      end;

  7. #7
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If debug doesn't say Found Light, that means it couldn't find the color you're using.

  8. #8
    Join Date
    Jan 2012
    Posts
    468
    Mentioned
    3 Post(s)
    Quoted
    200 Post(s)

    Default

    its so hard to get a color on these things!

  9. #9
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Use TPA, and color finding using ACA with CTS2.

  10. #10
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    1. i want to assume you are, but are your calling useOnLight(); right after FindLantern(); in your main loop.

    2. in the debug (after you run it) do you see "Found Light"


    edit: lol so slow at typing. i type a message, and little do i know, 4 messages already were made since i started typing.

    edit2: here is a link to the most recent ACA: http://villavu.com/forum/showpost.ph...7&postcount=49
    Last edited by x[Warrior]x3500; 06-01-2012 at 03:07 AM.

  11. #11
    Join Date
    Jan 2012
    Posts
    468
    Mentioned
    3 Post(s)
    Quoted
    200 Post(s)

    Default

    Compiled successfully in 1092 ms.
    SRL Compiled in 16 msec
    Found Light
    Successfully executed.

    thats what i get!
    but it its to slow at right clicking on them!

  12. #12
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    Quote Originally Posted by Rules of Joe View Post
    Compiled successfully in 1092 ms.
    SRL Compiled in 16 msec
    Found Light
    Successfully executed.

    thats what i get!
    but it its to slow at right clicking on them!
    wait(RandomRange(1000,2000));
    ClickMouse2(False);
    Wait(RandomRange(1000,1500));
    well duh its slow :P ur waiting 1-2 seconds before and after your click

  13. #13
    Join Date
    Dec 2011
    Posts
    392
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Your code also include setupsrl; correct? Without it your mouse speed will be slow :P

  14. #14
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Can be shorten and make it faster.

    Simba Code:
    WriteLn('Found Light');
        Mouse(gX, gY, 5, 5, mouse_Right);
        WaitOption('se Sap', 2000);

  15. #15
    Join Date
    Jan 2012
    Posts
    468
    Mentioned
    3 Post(s)
    Quoted
    200 Post(s)

    Default

    Quote Originally Posted by CephaXz View Post
    Can be shorten and make it faster.

    Simba Code:
    WriteLn('Found Light');
        Mouse(gX, gY, 5, 5, mouse_Right);
        WaitOption('se Sap', 2000);
    Thanks that did help!

    but the problem was in the Box that it was looking for the Light in! was to small!
    and how can i make it so that if it fails to repeat it self@

  16. #16
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You're finding the light on the main screen? If so then use

    Simba Code:
    FindColorSpiralTolerance(gX, gY, 8871996, MSX1, MSY1, MSX2, MSY2, 25)

    MS stands for Main Screen.

    Post a picture of the light here, I'll see what could be done with a finding function.
    EDIT: Maybe some other time lol, gonna sleep now.
    Last edited by CephaXz; 06-01-2012 at 03:32 AM.

  17. #17
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by Rules of Joe View Post
    Thanks that did help!

    but the problem was in the Box that it was looking for the Light in! was to small!
    and how can i make it so that if it fails to repeat it self@
    well then make the box bigger to ensure the light is within the box?
    for repeating, either use a repeat/while loop:
    while not FindDTM(blabla) do wait(100);
    or
    WaitFindDTM(blabla);

  18. #18
    Join Date
    Jan 2012
    Posts
    468
    Mentioned
    3 Post(s)
    Quoted
    200 Post(s)

    Default

    The light creature is not a DTM so im fucked and cant not make it into a DTM!

  19. #19
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    are u talking about those floating blue thing in the tear of guthix cavern? Can u post a pic of it?

  20. #20
    Join Date
    Jan 2012
    Posts
    468
    Mentioned
    3 Post(s)
    Quoted
    200 Post(s)

    Default



    Script is taking me a While Cuz its a quest Script! and its my First Script With Simba!
    Last edited by BigRedJapan; 06-01-2012 at 04:00 AM.

  21. #21
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    418
    Mentioned
    2 Post(s)
    Quoted
    86 Post(s)

    Default

    Did you get it to work?

  22. #22
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I believe DTM can be used on anything. But in your case its not that efficient to use it here.

    Is that blue thing in your screen the light that you wanted to use your lantern on?

  23. #23
    Join Date
    Jan 2012
    Posts
    468
    Mentioned
    3 Post(s)
    Quoted
    200 Post(s)

    Default

    Yes

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
  •