Page 1 of 2 12 LastLast
Results 1 to 25 of 29

Thread: DTM failed

  1. #1
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default DTM failed

    SCAR Code:
    program DTMw;
    {.include SRL\SRL.scar}

    Function Dced: Boolean;
    var Dc, Dcx, Dcy:Integer;
    Begin
      Dc := DTMFromString('78DA638C626060D0644001C9060C0CFF81342' +
           '394CFB8054818A0A909B584C8C1D43001096354355181686AD881' +
           '841C01355B08AB01000D3207CD');

      Result:= (FindDTM(Dc, Dcx, Dcy, 280, 170, 470, 200));
      FreeBitmap(Dc);
    End;

    Procedure CDTM;
    begin
      if (Dced) then writeln('found dtm') else
      begin
      writeln('not found dtm');
       exit;
      end;
    end;

    begin
    setupsrl;
    CDTM
    end.

    that dtm is a dtm of the login character on the main screen. the "test" option finds it, but the script doesn't.
    Oh Hai Dar

  2. #2
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    By the way, your using FreeBitmap to free a DTM

    As for the dtm, maybe try doing it again? And, loginplayer; is fixed in latest dev svn.

  3. #3
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    Ok ty.

    An other question, how do I make my script keep on looking for a color/bitmap until "Isuptext=xx"?

    SCAR Code:
    procedure lookforcolor;
    var x, y, color:integer;
    Begin
      Color:=Bitmapfromstring('1337');
      repeat //?
        Findbitmap(color, x, y)
     until ?
    Last edited by Main; 09-04-2009 at 08:46 AM.
    Oh Hai Dar

  4. #4
    Join Date
    Aug 2007
    Posts
    152
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  5. #5
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Main_Ftw View Post
    Ok ty.

    An other question, how do I make my script keep on looking for a color/bitmap until "Isuptext=xx"?
    SCAR Code:
    procedure lookforcolor;
    var x, y, color:integer;
    Begin
      Color:=Bitmapfromstring('1337');
      repeat
        Findbitmap(color, x, y)
     until(findbitmap(color,x,y)
    writeln('found') //or status
    terminatescript;

    Pretty sure it is. Add a
    Code:
    writeln('')
    And a terminatescript; so it stops when its found, knowing it works. or use status('').
    Last edited by Mr. Doctor; 09-04-2009 at 08:54 AM.

  6. #6
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Junkj View Post
    Pretty sure it is. Add a
    Code:
    writeln('')
    After the until so you know it works.
    Not at all, do:

    SCAR Code:
    repeat
      if findbitmap(BLAH)then
      mmouse(x, y, 2, 2);
    until(IsUpText('WTF'));//Child's play lol
    if IsupText('WTF')then
    begin
    writeln('yay it worked');
    result := true;
    end;

    Something like that, sorry for standards wrote in comment box
    Last edited by Smarter Child; 09-04-2009 at 08:57 AM.

  7. #7
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    That wasn't what I meant (because that isn't really a script).
    I want to ask, How do you make the script KEEP ON LOOKING for the color? cause if I just do
    SCAR Code:
    If (Findbitmaptolerance(somebitmap, somex, somey, sometolerance)) then
    Writeln('found')
    else writeln('not found');
    Does it look for the color/bitmap only once? (Because thats what I think it does.), if it DOES, how do I make it keep on looking until (lets say
    SCAR Code:
    until (Isuptext('some text')
    )?
    Last edited by Main; 09-04-2009 at 08:55 AM.
    Oh Hai Dar

  8. #8
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Main_FTW: I just posted, and good luck with your script

    Edit: Yah, read my example, ignore standards pl0x

    It will repeat finding the bitmap until the uptext is 'WTF' of course that is an example. then if the uptext is it will write in yay and result true, make sure you free bitmap!

    Edit: You might wanna do a time marker as a failsafe just in case it doesn't find the bitmap.
    Last edited by Smarter Child; 09-04-2009 at 08:58 AM.

  9. #9
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    Dumb me, ty.
    Oh Hai Dar

  10. #10
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No problem, I live to help Also Rep+ me if you want....

  11. #11
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Main_Ftw View Post
    That wasn't what I meant (because that isn't really a script).
    I want to ask, How do you make the script KEEP ON LOOKING for the color? cause if I just do
    SCAR Code:
    If (Findbitmaptolerance(somebitmap, somex, somey, sometolerance)) then
    Writeln('found')
    else writeln('not found');
    Does it look for the color/bitmap only once? (Because thats what I think it does.), if it DOES, how do I make it keep on looking until (lets say
    SCAR Code:
    until (Isuptext('some text')
    )?
    Using some vars...
    SCAR Code:
    Procedure lookforbitmap;
    var found :integer;
    begin
    repeat
    If (Findbitmaptolerance(somebitmap, somex, somey, sometolerance)) then
    found:=found+1
    until(false)
    end;
    And smarter btw you dont need
    Code:
    until(poop)
    if(poop)//this
    As until already will find it.

  12. #12
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Junkj View Post
    Using some vars...
    SCAR Code:
    Procedure lookforbitmap;
    var found :integer;
    begin
    repeat
    If (Findbitmaptolerance(somebitmap, somex, somey, sometolerance)) then
    found:=found+1
    until(false)
    end;
    And smarter btw you dont need
    Code:
    until(poop)
    if(poop)//this
    As until already will find it.
    WTF, that will just keep repeating the bitmap search and increasing 1 until it becomes FALSE!!!

    And you do need the if/then statement after if you want it to debug and result.

    Main_FTW: Trust me, I know what I am doing, I have done something similar to this before.

    Edit: @ junkj - found := found +1; is slower than Inc(Found), and that could be an extra failsafe, but time markers are just as easy to work with.
    Last edited by Smarter Child; 09-04-2009 at 09:06 AM.

  13. #13
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No it wouldn't, if it finds the bitmap, then it will increase by 1 and keep repeating to find the bitmap, and if it finds it again it increase the var by 1.

  14. #14
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Junkj View Post
    No it wouldn't, if it finds the bitmap, then it will increase by 1 and keep repeating to find the bitmap, and if it finds it again it increase the var by 1.
    .....lol, are you dumb or something? I just explained why that wouldn't work......try opening scar and running this:
    SCAR Code:
    program New;
    var
      tries: integer;
    begin
      repeat
        Writeln('OMG');
        Tries := Tries + 1;
      until(false);
    end.

    It will just debug omg endlessly...false is when it results false, that is an endless loop.

    i am
    THE Smarter Child , lol. Main_FTW : good luck~!
    Last edited by Smarter Child; 09-04-2009 at 09:14 AM.

  15. #15
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Writeln('') is not the same as If(123)then. I wouldn't be the one calling other people dumb.

  16. #16
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol?? try it with an if and then statement, similar results will occur . By the way, it doesn't look like your that smart either..Anyways, i am not going to continue arguing with you.

    hmm, well try something like this, drag cross hairs over the play button bar.
    SCAR Code:
    program New;
    var
      tries: integer;
      x, y: integer;
    begin
      repeat
        if FindColor(x, y, 6126318, 54, 4, 73, 20)then
        Tries := Tries + 1;
        Writeln(IntToStr(Tries));
     until(false);
    end.

    See it debug the tries forever..

    Edit: 5 people viewing the thread, wow lol.
    Last edited by Smarter Child; 09-04-2009 at 09:25 AM.

  17. #17
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well, if you want this to end please try and refrain to call other people dumb and wtf. You aren't gonna get any far with that.

  18. #18
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Junkj View Post
    Well, if you want this to end please try and refrain to call other people dumb and wtf. You aren't gonna get any far with that.
    Get any far with what, I was right and you were wrong

  19. #19
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    So if I wanna (lets see.. find a bank!)
    IGNORE STANDARDS AND CRAP
    SCAR Code:
    Procedure findbank;
    var bankcol, x, y:integer;
    begin
      x:=mscx;
      y:=mscy;
      bankcol:=1337;
      repeat
      if  FindColorSpiralTolerance(x, y, bankcol, msx1, msy1, msx2, msy2, 255) then
      MMouse(x,y,0,0)
     until  (Isuptextmulticustom('bank'))
      mouse(x,y,0,0,true);
    end;
    ?
    Oh Hai Dar

  20. #20
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Do: if Isuptextmulticustom('bank') after the until. yes that seems about right.

    Edit: but i don't see why you need to repeat it, findcolorsspiraltolerance should find it in one shot. and lower the tol, lol, unless its only gonna be in example

  21. #21
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Rule #3 - Don't get yourself into flame wars

    Flaming is heavily insulting or fighting with another member of the forums. It really is just a waste of space and causes two (or more) people to hate each other. If you get in a big flame war, you're scarred for life in the eyes of anyone who sees it, thinking you have a short temper. Even so, it's always nice if you make up in the end . If you REALLY have to do it, then take it to the BBQ Pit section of the forums, or on IM.

    Rule #5 - Get at least some SRL/Scar knowledge

    As you use scripts, look through the script and think, "What does this procedure do?". Try to answer your own question. If you really can't do it, look at some basic tuts in the Tutorial Island section under Beginner Tutorials. This way, you'll be able to fix simple errors without bugging other people. Don't forget to learn to make your own scripts eventually though (I'll explain why in a bit).

    Btw main, Smarter Child can answer this one.

    i am
    THE Smarter Child

  22. #22
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay lol, I am not really trying to flame you, but, i do have SRL\Scar knowledge, I am an SRL member for crying out loud, that rule is meant for you, don't confuse people . And the THE Smarter child is a joke. Don't take things way too seriously, can't you take a joke.

    Edit: 5 members, 1 guest viewing thread, lol, didn't know this would get views
    Last edited by Smarter Child; 09-04-2009 at 09:37 AM.

  23. #23
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol??
    Lol??
    Get any far with what, I was right and you were wrong
    lol, are you dumb or something
    Can i still take a joke??

  24. #24
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    @smart
    Can you remake that example procedure?
    Oh Hai Dar

  25. #25
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Junkj View Post
    Can i still take a joke??
    Why the hell are you taking this so far? What is done is done, stop leading this thread off topic. For our selfish reasons, we're messing this thread with comments relating nothing to Main_FTW's problem.

    @ Main_FTW: Pm me and i give you my msn, then i can help you anytime you need.

Page 1 of 2 12 LastLast

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
  •