← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #163613]: After a script runs 50 times I want to add a different keystroke to the script, how do I code that?

 

Question #163613 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/163613

joel hatzfeld posted a new comment:
I'm not looking to exclude the

type("T")

at any time, but having continued reading a little more, and then
reading what you suggested, I think I can explain what I'm looking to do
a little better.  I guess 'n' in the first line is what number in the
range I'm on, and then at 100 it will stop, is that correct?  in the
game it won't get through 100 cycles because the item the player uses
stops working at 75, so I think reading your if/elif/else code I should
increase my range to 300 and use something like


if n <= 75:
          type("1")
elif n > 76 and n < 150:
          type("2")
elif n > 151 and n < 225:
          type("3")
else
          type("4")
          type("T")

pressing 1-4 changes a hotkey to interchangeably switch out the items
used, and they're all duplicates so reading the suggestion you're given
me makes me assume that during the first 75 cycles it will use the item
the player has equiped, then by pressing 1-4 during the cycles between
76-300 it will attempt to equip whatever item is on the players hotbar
(no negative side effects if it is already equipped).  Pressing "T"
opens a window so it can't be moved or switched.

with regards to the spacing / tab issue, I don't understand the why
behind what you're saying, but I can certainly understand the "you
should use tab instead of 8 blanks" portion, and I'll change that too.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.