Jump to content

Running a code while on a different windows user


Tool
 Share

Recommended Posts

ok so i want this to work on user1 when im on user2. what i mean is run this script on 1 user on pc then log in and be on a different user aka user2. im pretty sure everything works in this code when im on user2 except

"MouseClick("left", 403,405,1)

sleep(250)

MouseClick("left", 425,476,1)

sleep(250)"

that part any ideas? keep in mind im really new to autoit.

call ("startup")

func startup()
Run ( "D2BS.EXE","")
sleep(600)
Run( "C:\Program Files\Diablo II\Diablo II.exe -w")
WinWait("Diablo II")
WinSetState("Diablo II","",@SW_MINIMIZE)
sleep(650)
call ("dstart")
EndFunc

func dstart()
MouseClick("left", 403,405,1)
sleep(250)
MouseClick("left", 425,476,1)
sleep(250)
ProcessClose("D2BS.exe")
WinWait("Diablo II")
WinSetState("Diablo II","",@SW_MAXIMIZE)
sleep(250)
call ("exep")
EndFunc

func exep()
   winwait("Diablo II E")
   Sleep(3000)
   ProcessClose("game.exe")
   sleep(3000)
   call ("startup")
   EndFunc
Edited by Tool
Link to comment
Share on other sites

i tryed doing that and i used controlclick and it worked try that

im not quite sure in how to do that but ill try :)

Ok -edit- this is what i got but i dont think there is a window name for d2bs so what should i do? im going to test this right now tell me if you think it should work. another-edit- just tested and it says error line -1 exrpession error =/

call ("startup")

func startup()
Run ( "D2BS.EXE","")
sleep(600)
Run( "C:\Program Files\Diablo II\Diablo II.exe -w")
WinWait("Diablo II")
WinSetState("Diablo II","",@SW_MINIMIZE)
sleep(650)
call ("dstart")
EndFunc

func dstart()
ControlClick("D2BS", "", [, Left [, 1 [, 425[, 405]]]] )
sleep(250)
ControlClick("D2BS", "", [, Left [, 1 [, 425[, 476]]]] )
sleep(250)
ProcessClose("D2BS.exe")
WinWait("Diablo II")
WinSetState("Diablo II","",@SW_MAXIMIZE)
sleep(250)
call ("exep")
EndFunc

func exep()
   winwait("Diablo II E")
   Sleep(3000)
   ProcessClose("game.exe")
   sleep(3000)
   call ("startup")
   EndFunc
Edited by Tool
Link to comment
Share on other sites

  • Developers

these are wrong:

ControlClick("D2BS", "",[, Left[, 1[, 425[, 405]]]])
    ControlClick("D2BS", "",[, Left[, 1[, 425[, 476]]]])
Try using the Full SciTE4Autoit3 and run the script from it with F5.

That will first run au3check and report on possible errors.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

these are wrong:

ControlClick("D2BS", "",[, Left[, 1[, 425[, 405]]]])
    ControlClick("D2BS", "",[, Left[, 1[, 425[, 476]]]])
Try using the Full SciTE4Autoit3 and run the script from it with F5.

That will first run au3check and report on possible errors. well i dont think its clicking at all =/

Jos

Ok i fixed those two lines but it doesnt click where it is supposed to still =[

call ("startup")

func startup()
Run ( "D2BS.EXE","")
sleep(600)
Run( "C:\Program Files\Diablo II\Diablo II.exe -w")
WinWait("Diablo II")
WinSetState("Diablo II","",@SW_MINIMIZE)
sleep(650)
call ("dstart")
EndFunc

func dstart()
ControlClick("D2BS", "", "Left" , 1 , 425, 405 )
sleep(250)
ControlClick("D2BS", "", "Left" , 1 , 425, 476 )
sleep(250)
ProcessClose("D2BS.exe")
WinWait("Diablo II")
WinSetState("Diablo II","",@SW_MAXIMIZE)
sleep(250)
call ("exep")
EndFunc

func exep()
   winwait("Diablo II E")
   Sleep(3000)
   ProcessClose("game.exe")
   sleep(3000)
   call ("startup")
   EndFunc
Edited by Tool
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...