How make a keypreser[AutoIt]

01/11/2012 21:19 bothpro#1
Hi alll
Im trying to making a simple KeyPresser in SRO with AutoIt...But this function work in all programs but dont work on a Sro...

Example:
Code:
Send ("{DOWN}")
It dont work in a silkroad...

Can anyone help me please ;D

Im waiting answer

Ty all
01/11/2012 21:36 yurka333#2
First, some version of Silkroad doesn't allow using even AutoIt.
Second, Send ("{DOWN}") is command to send Down arrow, which doesn't do anything in Silkroad, try better something like Send("S") or Send("{ENTER}")
Third, here a lot of guides how to use AutoIt in Silkroad.
01/15/2012 19:39 Singa#3
Put #RequireAdmin on the top of your script.
01/15/2012 19:47 ovidiu#4
Here`s a simple one , dosen`t work on sro while minimized , but it dosen`t send keys to anything else other than sro:

Code:

Quote:
Global $Paused
HotKeySet("{F6}", "Pause")
HotKeySet("{F7}", "Terminate")
HotKeySet("{F5}", "start")
HotKeySet("{F8}", "minimize")

$handle = WinGetHandle("classname=CLIENT", "SRO_CLIENT")
$t = 1

While 1
Sleep (50)
WEnd

Func minimize()
WinSetState($handle, "", @SW_MINIMIZE)
EndFunc

Func start()
While $t =1
If @error Then
MsgBox(4096, "Error", "Could not find the correct window")
Else
ToolTip("Started",0,0)
Opt("SendKeyDelay",100)
ControlSend($handle, "", "Edit1", "1")
ControlSend($handle, "", "Edit1", "2")
ControlSend($handle, "", "Edit1", "3")
ControlSend($handle, "", "Edit1", "4")
ControlSend($handle, "", "Edit1", "5")

EndIf
ToolTip("",0,0)

WEnd
EndFunc


Func Pause()
$Paused = NOT $Paused
While $Paused
ToolTip("Paused",0,0)
sleep(100)
WEnd
ToolTip("",0,0)
EndFunc

Func Terminate()
Exit 0
EndFunc
01/17/2012 06:49 bothpro#5
Ty all for answers ;D

And yes Ovidiu your code worked perfectly, what I was looking!!!!

Now im trying put on my script a simple mouse click but dont work in silkroad with the same error that I had(this function work in all programs but dont work on a SRO)...

i try: MouseMove, MouseClick, ControlClick and notinhg...:

Code:
MouseMove(526,557)
MouseClick("") 
MouseClick("Left",76, 749,1)

MouseClick("click","texto",$handle,"left",Random(0,@DesktopWidth,1),Random(0,@DesktopHeight,1))

ControlClick($handle,"left",Random(0,@DesktopWidth,1),Random(0,@DesktopHeight,1))


ControlClick($handle, "", "Edit1","left",Random(0,@DesktopWidth,1),Random(0,@DesktopHeight,1))
And other question...pixelsearch work on sro? And if yes, how i can click when this fiand a gold for example....
Code:
$coord = PixelSearch( 0, 0, 800, 600, 0x277DC3)
$pos = MouseGetPos()
$var = PixelGetColor( $pos[0] , $pos[1] )
Ty Again


PS:I tried to find AuotIt Guide for Sro, but i dont found....

I waiting for new answers
01/18/2012 13:53 srutownik#6
HackShield is blocking mouse emulating. I've found a solution for this problem. It is crazy, but it work!
You can't use mouse emulating when SRO_Client is on focus. Hackshield don't block autoit when other aplication is on focus. So, when you will put a function like WinActive("CLASS:Shell_TrayWnd") (it will set Start bar on focus) after every MouseMove, MouseClick, program will do it. Even if it will click in Silkroad window, it will work.
But remember to paste that function before every mouse event.
01/20/2012 07:08 deeplogic#7
Given the complexities and in-game UI dynamics of SRO, I don't think a Sendmessage() or other input macro like autoit are such a good idea..

Pro bots don't even do it, they'll leave an inventory window open for example and decide based on inline data and packet handlers..
01/20/2012 07:55 bothpro#8
Yes i know, but im newbie in packets, i dont understand how to send code (of moob or npc...) to the server...

Anyway i tried : WinActive("CLASS:Shell_TrayWnd"), but fail :/

Waiting for more answers
01/21/2012 01:00 PortalDark#9
anyone got autoit code to write on chat?
if it work for gm console, it would be incredible
01/21/2012 18:53 Keyeight#10
for the one who need to make an autoit keypresser just learn this lang good and make it cuz every one have his coding way and its hard to work on some one eals work just an advise if you need it with c#
i can help with that