Author Topic: AutoIT  (Read 2975 times)

0 Members and 1 Guest are viewing this topic.

Offline FluwtonTopic starter

  • Jr. Member
  • **
  • Posts: 16
  • Activity:
    0%
  • Reputation Power: 1
  • Fluwton has no influence.
  • Shorn scrotum and fancy-free!
  • Respect: 0
  • Referrals: 0
    • View Profile
AutoIT
« on: May 17, 2014, 11:54:57 PM »
0
Not sure if this is known, but AutoIT (http://www.autoitscript.com/site/autoit/) can work with UO.

I tried it out and it didn't work at first.  UO is apparently set to ignore keypresses and mouseclicks initiated by other programs.

The trick was to run UO in a sandbox (http://www.sandboxie.com/) so it couldn't tell the keypresses were coming from a program instead of the keyboard.

To get anybody interested started, here's a sample loop to work hiding and spellweaving via Essence of Wind.  CTRL-F1 = Hide, 3 = EoW, ESC = Quit script.

It'll loop completely 4 times.
Each loop consists of 1 hide, a 0.2 second pause, then 4 Essence of Winds with a 3 second pause between them.

If you run out of mana hit escape and wait for it to regenerate.  The number of outer loops can be tweaked to your mana pool and regen, the number of inner loops should stay the same to maintain the proper timing between hide attempts.

This is for attended use.  For those interested in unattended, I direct you to If statements and PixelGetColor.

Code: [Select]
WinActivate("[#] Ultima Online")
HotKeySet("{ESC}","Quit")
for $i = 1 to 4
   send("^{F1}")
   sleep(200)
   for $j = 1 to 4
  send("3")
  sleep (200)
  send("{Backspace}")
  sleep(3000)
   Next
Next

func Quit()
   Exit
EndFunc

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13304
  • Activity:
    0.6%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: AutoIT
« Reply #1 on: May 18, 2014, 11:08:16 AM »
0
I used AutoIt in UO way back in 2006 when the map would get corrupted with housing from a previous facet.  So you needed to completely stop UO, and basically reboot it.  AutoIT fit that perfectly.  These days I just write a C# .NET program to do basically the same thing.
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: