Jump to content

if then else otherwise


Recommended Posts

ok, this should be plain dead simple but I simply can't see the solution.

mpstart1()
if $type="closed" then closed1()

;; click for multiplayer startup
Func mpstart1()
MouseMove(500,350)
MouseDown("left")
MouseUp("left")
Sleep(1000)
EndFunc

;;click for closed internet
func closed1()
MouseMove(500,345)
MouseDown("left")
MouseUp("left")
Sleep(1000)
Send($password)
EndFunc

;;click for open internet
func open1()
MouseMove(500,380)
MouseDown("left")
MouseUp("left")
Sleep(1000)
Send($password)
EndFunc

if you look on the second code line it says that if the returnvalue from the ini is closed then run function closed. How can I tell it that it needs to run function closed when the word is closed and when the word is open to run the function open?

Link to comment
Share on other sites

ok, this should be plain dead simple but I simply can't see the solution.

mpstart1()
if $type="closed" then closed1()

;; click for multiplayer startup
Func mpstart1()
MouseMove(500,350)
MouseDown("left")
MouseUp("left")
Sleep(1000)
EndFunc

;;click for closed internet
func closed1()
MouseMove(500,345)
MouseDown("left")
MouseUp("left")
Sleep(1000)
Send($password)
EndFunc

;;click for open internet
func open1()
MouseMove(500,380)
MouseDown("left")
MouseUp("left")
Sleep(1000)
Send($password)
EndFuncoÝ÷ Ú'ò¢éh¢J'¶¬yÊ'uÊzX§z+lk+-«b~Ø^­ën®{Úç®­è§+vØ^»§~éܶ*'rZ,yÑèÁƧ"×¥+m«b¶wvËh®éߺw-Üw^Ø^ÂÝÇ%¢Çjwpéíì(­Ø¬¢§¶îØ^~éܶ*'¢§þ«¨µå¡jÛ¶Í7êÜ©x-êÞjr'vß±ÊÞzr-r¥vZ(X¤zØb±«­¢+ÙµÁÍÑÉÐÄ ¤)MÝ¥Ñ %¹¥I ÅÕ½ÐíèÀäÈí5å¥ÈÀäÈí5奱¹¥¹¤ÅÕ½Ðì°ÅÕ½Ðí5åMÑ¥½¸ÅÕ½Ðì°ÅÕ½ÐíQåÁÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì¤(%
ÍÅÕ½Ðí=Á¸ÅÕ½Ðì($%=Á¸Ä ¤(%
ÍÅÕ½Ðí
±½ÍÅÕ½Ðì($%
±½ÍÄ ¤(%
ͱÍ($%5Í    ½à ÄØ°ÅÕ½ÐíÉɽÈÌÌìÅÕ½Ðì°ÅÕ½Ðí
͹½Ð¡¹±è%¹Ù±¥QåÁÌÌìÅÕ½Ðì¤)¹MÝ¥Ñ (

:D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

there's indeed a ini file where needs to be selected wheter it will be open or closed...

the only problem I'm still having is the game starting.

It starts and quits directly. aint normal.

but I think that has something to do with the game.

ans the reason I wanted it to be 1 line was to make my code smaller...but that has been solved also by plato.

Edited by Overlord
Link to comment
Share on other sites

...ans the reason I wanted it to be 1 line was to make my code smaller...but that has been solved also by plato.

no UDFs needed - if I understand the code snippet correctly
;; click for multiplayer startup
MouseClick("left", 500, 350, 1, 0)
Sleep(1000)

;; click for closed internet
If $type = "closed" Then MouseClick("left", 500, 345, 1, 0)

;; click for open internet
If $type = "open" Then MouseClick("left", 500, 380, 1, 0)

Sleep(1000)
Send($password)
Send("{ENTER}")
Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

  • Developers

ans the reason I wanted it to be 1 line was to make my code smaller...but that has been solved also by plato.

Glad that Plato understood it and solved it ...

Plato, could you explain to me what you specified that I didn't ? I got my brain offline today so can't think .. :D

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

...Plato, could you explain to me what you specified that I didn't ?...

I was just being funny or stupid (depending on how you look at it).

You posted Overlord's existing line of code as a reference of where to place your additional one line of code as a solution to the OP.

Overlord asked if it could be posted [not coded] in one line.

...so, I re-posted your one line solution as one line of code... not two lines - stupid huh?

...but I guessed that the overall desire was for a shorter script - so I included the MouseClick suggestion so that my post would not be worthless. I think that is what Overlord was talking about when thanking me... but I'm still not positive of that.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

  • Developers

I was just being funny or stupid (depending on how you look at it).

You posted Overlord's existing line of code as a reference of where to place your additional one line of code as a solution to the OP.

Overlord asked if it could be posted [not coded] in one line.

...so, I re-posted your one line solution as one line of code... not two lines - stupid huh?

...but I guessed that the overall desire was for a shorter script - so I included the MouseClick suggestion so that my post would not be worthless. I think that is what Overlord was talking about when thanking me... but I'm still not positive of that.

Didn't realy expect an answer :D ... but I now you did it anyways, I am glad to see it's not just me scratching my head ...

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

Didn't realy expect an answer :D...

Your English is great, but since I was poking fun at a nuance - I thought it deserved a bit of detail in case others wondered why "posted" was in red.........later Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

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...