Jump to content

Help Please :D


Jimbo
 Share

Recommended Posts

Hello All

This is my 1st time on these Boards, Hooray!

Now, Lets get down to Business

Im am trying to Create an Auto Login script for Mu Online.

Could Anybody Please help me do this? i made a very basic one, my 1st ever try LOL, failed Misrablelly

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.0
; Author:        Jimbo  <********@hotmail.com>
;
; Script Function:
;   Template AutoIt script.
;
; ----------------------------------------------------------------------------

; Script Start - Add your code below here'
;Wait X amount of milliseconds before starting 3600000 = 1 Hour
;Sleep (3600000)
;Run Mu.exe
Run ("C:\Program Files\Webzen\Mu\Mu.exe", "C:\Program Files\Webzen\Mu")
;Wait for Connect Button
Sleep (10000)
;Click Connect Button
MouseClick("left", 636, 683, 2)
;Wait Until Server is Loaded
;Sleep (60000)
;Click On Maya
MouseClick("left", 512, 388, 2)
;Select Server 4
MouseClick("left", 669, 379, 2)
;Wait For Pw Screen
;Sleep (5000)
;Send Password
Send ( "******" , 1 )
;Press Enter
Send ("Enter",0)
;Wait For Characters
;Sleep (5000)
;Click on DK
MouseClick("left", 258, 531, 2)
;Click OK
MouseClick("left", 790, 251, 2)
;Wait to Load
;Sleep (10000)
;Press F11
Send("F11",0)
;Press Enter
Send ("Enter",0)
;/Request off
Send ( "/request off" , 1 )
;Press Enter
Send ("Enter",0)
;Start Bot (Press NumPad7)
Send ("NUMPAD7",0)
;End of Auto Connect Bot Made by Jimbo!!!!

;Server 1
;MouseClick("left", 969, 353, 2)

Lol, i think i missed a few things....

i laugh at my own failure lol....

ScreenShots Included

1) Need to run Main exe

Run ("C:\Program Files\Webzen\Mu\Mu.exe", "C:\Program Files\Webzen\Mu")

<--Works

1) Connect Button, Co Ords Are 636, 683, Needs To Be clicked after opening, (Need to Wait for connect button to appear) 5~10 Seconds, Then wait about 40 Seconds before continuing to step 2

2) Need to Click on "Maya" (512, 388) And then "Server 4" (669, 379)

3) Need to wait for Password Area to Show (Again 5~10 Seconds)

4) Need to type in Password, then Press Enter

5) Needs to click MouseButton at (258, 531) For my character, and then Ok (790, 251)

6) Needs to Press enter & Type "/request off" and then enter again

7) Needs to Press F11 And then wait 5 seconds before pressing Numpad7

6)Need to wait 5~10 Seconds to Load

Well, For my 1st ever script.. (can it be called a script?) Lol.. oh well i gues you dont get anywhere without asking for help!!

Jimbo

Link to comment
Share on other sites

Welcome to the forums!

This is a fantastic first effort but here are some pointers:

  • You may be able to wait for the connect button using a PixelGetColor() call in a While..WEnd loop -- i.e. check the colour of a pixel on the screen while that pixel does not match a certain colour.
  • Your Send("Enter", 0) line should probably be Send("{ENTER}").
  • Similarly you will need to correct the lines that send F11 and NumPad 7.
Good luck getting it to work the way you want!
Link to comment
Share on other sites

  • Moderators

Welcome the forum Jimbo :whistle:

Are your coords Screen|Client|Window ? (AutoInfo)

Do your program windows have Titles or Class? (AutoInfo)

Does your input box have a Control ID or ClassNameNN? (AutoInfo)

Where exactly does it fail at (I assume it's the second (1)?

Have you tried to remove or lessen the sleep to test it?

Do you want this to run every hour or just the 1 time after an hour?

In the AutoInfo tool, under options, then under Coord Mode... what is checked. If it is Screen Coords and you do have a Title or Class, might I suggest making them client coords... then it looks like it would be just a few 'Clicks' away for us to help :dance:.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Welcome the forum Jimbo :whistle:

Are your coords Screen|Client|Window ? (AutoInfo)

Do your program windows have Titles or Class? (AutoInfo)

Does your input box have a Control ID or ClassNameNN? (AutoInfo)

Where exactly does it fail at (I assume it's the second (1)? 

Have you tried to remove or lessen the sleep to test it?

Do you want this to run every hour or just the 1 time after an hour?

In the AutoInfo tool, under options, then under Coord Mode... what is checked.  If it is Screen Coords and you do have a Title or Class, might I suggest making them client coords... then it looks like it would be just a few 'Clicks' away for us to help :dance:.

<{POST_SNAPBACK}>

CoOrds = Screen

Title: MU Auto Update

Class: #32770

Control ID: 1999

ClassNameNN: Button2

Well, Ill put it his way, i want to make the script because On tuesdays after i go to school, 1 hour later there is server maintenence, which also goes for 1 hour, u want to go to school then i can get it to connect me in X amount of hours, Btw, in game, As seen in my screenshots, Where is says "Maya" and "Wigle" Everything in AutoInfo Tool is blank.... except the mouse details

*EDIT* With the Script too, The connect Button bit works fine, But it seems when it come to clicking on "Maya" and "Server 4", The Mouse Will not move

Edited by Jimbo
Link to comment
Share on other sites

  • Moderators

Cool... I'll have a look for you... are all the screen name titles the same?

And does the Input box where you put your username / and password have a control ID?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Cool... I'll have a look for you... are all the screen name titles the same?

And does the Input box where you put your username / and password have a control ID?

<{POST_SNAPBACK}>

No, The box where i have to click Connect is called MU Auto Update

When im in the game and have to select server, its called MU

No Control ID on the pw Box, Just looks like the screenie below, empty..

Screenies Attached

Edited by Jimbo
Link to comment
Share on other sites

Hi buddy!

Run ("C:\Program Files\Webzen\Mu\Mu.exe", "C:\Program Files\Webzen\Mu")

No need to put the path after, just do

Run("C:\Program Files\Webzen\Mu\Mu.exe")

I am a noob too but I suggest you do that because the less there is code the easier is to understand it :whistle: I wish you good luck with your scripts :dance:

- Gaboury.

Link to comment
Share on other sites

  • Moderators

Sorry, I got tied up for a bit:

Try this... I tried to comment it out a bit for you.. but I was in bit of a rush.

; Script Start - Add your code below here'
;Wait 1 Hour
Global $WINDOW = "MU"
Opt("WINTITLEMATCHMODE", 4); IF WE USE TITLES, WE SHOULD MAKE SURE WE KNOW HOW WE WANT TO LOOK FOR THEM
Opt("MOUSECOORDMODE", 2); DEFAULT MOUSECLICKS ARE SET TO 0, YOU ARE USING CLIENT COORDS, THAT SHOULD BE 2
; JUST A DIFFERENT WAY TO BE MORE PRECISE W/ THE TIMING
$TIMER = TimerInit()
Do
    Sleep(100); NOT BURNING OUT THE CPU / CHECKS 1/10TH OF A MILLESECOND TO SEE IF THE HOUR IS UP
Until (TimerDiff($TIMER) / 1000) / 60 >= 60;<< 60 REPRESENTS 60 MINUTES

#CS
AFTER THE HOUR IS UP NOW THE REST OF YOUR SCRIPT WILL RUN
I'M NOT CHANGING ANY OF YOUR SCRIPT EXCEPT THE SEND'S... TO MAKE SURE 
THERE ARE NO OTHER ERRORS SINCE I DON'T HAVE THE PROGRAM TO TEST FOR MYSELF
#CE
Run ("C:\Program Files\Webzen\Mu\Mu.exe", "C:\Program Files\Webzen\Mu")
;Wait for Connect Button
WinWaitActive($WINDOW, "", 10); WAITS FOR THE WINDOW TO EXIST AND BE ACTIVE FOR 10 SECONDS
;Click Connect Button
MouseClick("left", 636, 683, 2, 1); ADDED THE ONE ON THE END FOR SPEED... IF YOU DON'T NEED IT REMOVE IT AND THE COMMA BEFORE IT
;Wait Until Server is Loaded
;Sleep (60000)
;If Not WinActive($WINDOW) Then WinActivate($WINDOW)
;Click On Maya
MouseClick("left", 512, 388, 2, 1)
;Select Server 4
MouseClick("left", 669, 379, 2, 1)
;Wait For Pw Screen
;Sleep (5000)
;Send Password
Send ("******" , 1 )
;Press Enter
Send ("{ENTER}")
;Wait For Characters
;Sleep (5000)
;Click on DK
MouseClick("left", 258, 531, 2, 1)
;Click OK
MouseClick("left", 790, 251, 2, 1)
;Wait to Load
;Sleep (10000)
;Press F11
Send("{F11}")
;Press Enter
Send ("{ENTER}")
;/Request off
Send ("/request off", 1)
;Press Enter
Send ("{ENTER}")
;Start Bot (Press NumPad7)
Send ("{NUMPAD7}")
;End of Auto Connect Bot Made by Jimbo!!!!

;Server 1
;MouseClick("left", 969, 353, 2, 1)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Good point Gaboury, I didn't even look at that since he said it worked :whistle:.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Hi buddy!

Run ("C:\Program Files\Webzen\Mu\Mu.exe", "C:\Program Files\Webzen\Mu")

No need to put the path after, just do

Run("C:\Program Files\Webzen\Mu\Mu.exe")

I am a noob too but I suggest you do that because the less there is code the easier is to understand it :dance:  I wish you good luck with your scripts :dance:

- Gaboury.

<{POST_SNAPBACK}>

You need the extra "C:\Program Files\Webzen\Mu", if you dont you get a Mesage error which means you cant run the client :whistle:
Link to comment
Share on other sites

You need the extra "C:\Program Files\Webzen\Mu", if you dont you get a Mesage error which means you cant run the client

Yes, this is how many programs work, and I always include the working directory when I'm running something. If you don't include it, the program assumes that it's being run from the current location of the script (instead of its actual location), and looks in the wrong place for any external files it needs.

Link to comment
Share on other sites

You need the extra "C:\Program Files\Webzen\Mu", if you dont you get a Mesage error which means you cant run the client :whistle:

<{POST_SNAPBACK}>

Downloaded the game and tested out some stuff.

Once the game's screen is up (connected) No cursor control is possible.

No mousemove or mouseclick, not even with a dllcall (thats the only one thats actualy failing, the standard autoit one's say there ok, but are not)

The dllcall is working when you try it on a normal window, just comment out the game startup and you will see that it dous

Don't know off a solution to do it.

Run ("C:\Program Files\Webzen\Mu\Mu.exe", "C:\Program Files\Webzen\Mu")
WinWaitActive("MU Auto Update","")
While ControlGetText("MU Auto Update", "", "Static2") <> "Click connetion button to play game"
    sleep(100)
WEnd

While Not ControlCommand ( "MU Auto Update", "Connect", "Button2", "IsEnabled", "" )
    sleep(100)
WEnd
ControlClick ( "MU Auto Update", "Connect", "Button2" )
WinWaitClose( "MU Auto Update","")
WinWaitClose("MU launching","")
Winwait("MU","")
Sleep(20000);can try longer sleeps if the screen is not active yet
$move = Mousemove(150,100,50)
consolewrite("MouseMove = " & $move &@LF)
$click = MouseClick("left", 512, 388, 2, 100)
consolewrite("MouseClick = " & $click &@LF)
$ret = DllCall("user32.dll","int","SetCursorPos","int",100,"int",100)
consolewrite("DllCallMove = " & $ret[0] &@LF)
Sleep(1000)
WinSetState("MU","",@SW_MINIMIZE );the screen will flash for a second so you know when the script has ended
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...