Jump to content

Headache from this...


Recommended Posts

anyone got an idea how to make the ShowHide work?

It simply shows and hides again.. thats because the second cheking loops is after the first... Lost in my code... dunno how to force it work...

i should need somekinda ExitFunc command... or something... or somehow to force the function to work as i want.....

The result should be when I press pause it should hide and when i press it againt it should show... press again - hide ,press again - show and so on...

And it should depend on $s var.... (because if it crashed it should get the last status that user set'ed and do actions by that status ($s = 0 - hide , $s = 1 - show)

;Seting Var's

$s = 1

;Hide?

$answer = MsgBox(4, "Hide window?", "Do you want to hide emulator window?")
If $answer = 7 Then
   $s = 0
EndIf

;Options

Opt("WinTitleMatchMode", 2)

;Hotkeys

HotKeySet("{ESC}", "Terminate")
HotKeySet("{PAUSE}", "ShowHide")

;Script
If Not ProcessExists("wowemu.exe") Then
Run("wowemu.exe")
EndIf
sleep(50)
$title = WinGetTitle("wowemu.exe", "")
WinSetTitle($title, "", "World Of Warcraft Emulator by WAD + Jammer anticrash system")
if $s = 1 Then WinSetState("World Of Warcraft Emulator by WAD + Jammer anticrash system", "", @SW_HIDE)
if $s = 0 Then WinSetState("World Of Warcraft Emulator by WAD + Jammer anticrash system", "", @SW_SHOW)
While 1
    ProcessWaitClose("wowemu.exe")
    Run("wowemu.exe")
    sleep(50)
    $title = WinGetTitle("wowemu.exe", "")
    WinSetTitle($title, "", "World Of Warcraft Emulator by WAD + Jammer anticrash system")
    if $s = 1 Then WinSetState("World Of Warcraft Emulator by WAD + Jammer anticrash system", "", @SW_HIDE)
    if $s = 0 Then WinSetState("World Of Warcraft Emulator by WAD + Jammer anticrash system", "", @SW_SHOW)
WEnd

;Functions

Func Terminate()
    Exit 0
EndFunc

Func ShowHide()
if $s = 1 Then
$s = 0
    WinSetState("World Of Warcraft Emulator by WAD + Jammer anticrash system", "", @SW_SHOW)
EndIF
if $s = 0 Then
$s = 1
    WinSetState("World Of Warcraft Emulator by WAD + Jammer anticrash system", "", @SW_HIDE)
EndIF
EndFunc
Edited by Jammer
Link to post
Share on other sites

I would make it even shorter:

Func ShowHide()
   If $s = 1 Then
      WinSetState("World Of Warcraft Emulator by WAD + Jammer anticrash system", "", @SW_SHOW)
   Else
      WinSetState("World Of Warcraft Emulator by WAD + Jammer anticrash system", "", @SW_HIDE)
   EndIf
   $s = Not $s
EndFunc

I guess there is no other value than 0 or 1 for $s, so the $s = Not $s should do it.

Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...