Results 1 to 8 of 8

Thread: Failsafes

  1. #1
    Join Date
    Nov 2011
    Posts
    234
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default Failsafes

    Well i'm making a script but since it's my first script I have no idea how I can implement any failsafes i'm using tpa and dtm's for objects/npc's but since it sometimes misclicks I want it to try to click again but that's something I have no experience in and I coulden't find a dated guide about it.

    Also with the tpa I am in a area where most colors are the same so it mistakes one color for another any idea how I could prevent that?

  2. #2
    Join Date
    Nov 2011
    Posts
    1,532
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Not sure what script you're trying to implement, but the idea of failsafe has to do with how you are going to deal with something when it fails. For example, you might want to do a timeout if the script spends too much time and still cannot find the object/npc. There are just many things you can do.

    For the colors, you might want to try ACA to get your colors and limit your tolerance to a relatively low amount. Are you using CTS1 or CTS2 for color finding? The latter is more accurate, and can be useful if many similar colors are on the screen.

  3. #3
    Join Date
    Nov 2011
    Posts
    234
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by nosaj.421 View Post
    Not sure what script you're trying to implement, but the idea of failsafe has to do with how you are going to deal with something when it fails. For example, you might want to do a timeout if the script spends too much time and still cannot find the object/npc. There are just many things you can do.

    For the colors, you might want to try ACA to get your colors and limit your tolerance to a relatively low amount. Are you using CTS1 or CTS2 for color finding? The latter is more accurate, and can be useful if many similar colors are on the screen.
    All colors of the npc are the same as the ground and walls of the shop it's standing in exept the hair that's the problem I also used ACA for colorfinding but at a lower tolerance it can't find it becouse when the npc walks the hair is in a different direction and a different color.

    I would like the failsafe to repeat if it misclicks how could I do that (know it might sounds a bit bad but I really have no idea).

    Was using cts 1 I think so I will try cts 2 but I will still need some kind of failsafe.
    Last edited by jordi1104; 01-30-2012 at 01:25 PM.

  4. #4
    Join Date
    Nov 2011
    Posts
    1,532
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What is your click color? If it is red click then you want to try to detect this with DidRedClick. Maybe something like this.

    Simba Code:
    MarkTime(t);
    repeat
      ;//try clicking
      if DidRedClick then break;
    until (TimeFromMark(t) > whatevertimehere);
    if not (TimeFromMark(t) > whatevertimehere) then //that means we're successful
      ;//do your next step here

  5. #5
    Join Date
    Nov 2011
    Posts
    234
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    I will try that later thanks.
    Also it was redclick I believe.
    Whats the timemark anyway haven't seen it before.
    Last edited by jordi1104; 01-30-2012 at 01:54 PM.

  6. #6
    Join Date
    Nov 2011
    Posts
    1,532
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    MarkTime and TimeFromMark are functions that allow you to use a variable to determine the time elapsed. Very useful for timeout or any functions that involves time. If you're not familiar, it might be a good idea for you to read the Simba documentation.

  7. #7
    Join Date
    Nov 2011
    Posts
    234
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by nosaj.421 View Post
    MarkTime and TimeFromMark are functions that allow you to use a variable to determine the time elapsed. Very useful for timeout or any functions that involves time. If you're not familiar, it might be a good idea for you to read the Simba documentation.
    Learned alot from you thanks and I will do what you sayd.
    One more thing how can I make it wait till it sees color like if it can't find color then it waits for till it does.
    Last edited by jordi1104; 01-30-2012 at 05:02 PM.

  8. #8
    Join Date
    Nov 2011
    Posts
    1,532
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Look up the WaitColor series functions in SRL include.

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
  •