Author Topic: Cerv's Pause Button  (Read 3774 times)

0 Members and 1 Guest are viewing this topic.

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Cerv's Pause Button
« on: February 26, 2009, 11:45:37 AM »
0
Put this at the beginning of the script, where it will only be called ONE time. Maybe in the setup, depending on your script.

Code: [Select]
gosub showEUOMenu1
That will bring up the PAUSE button.

Now put this somewhere in your mainloop:

Code: [Select]
if #MENUBUTTON = pause
  gosub pause_script

That will watch the button for when it's pressed to pause the script.

Now just put in these two subs near the end of your script:

Code: [Select]
sub pause_script
  set %script paused
  set #MENUBUTTON N/A
  menu delete pause
  menu Font BGColor Red
  menu Button pause 0 0 115 45 UnPause
  while %script = paused
  {
    if #MENUBUTTON = pause
    {
      set %script unpaused
      menu delete pause
      menu Font BGColor Lime
      menu Button pause 0 0 115 45 Pause
      set #MENUBUTTON N/A
    }  
  }
return

;--------- EasyUO Menu Designer Code Begin ---------
sub showEUOMenu1
menu Clear
menu Window Title CP
menu Window Color BtnFace
menu Window Size 113 44
menu Font Transparent #true
menu Font Align Right
menu Font Name MS Sans Serif
menu Font Size 16
menu Font Style
menu Font Color WindowText
menu Font BGColor Lime
menu Button pause 0 0 115 45 Pause
menu Show 421 270
return
;--------- EasyUO Menu Designer Code End ---------
« Last Edit: April 11, 2011, 12:10:41 PM by Cerveza »
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Tags: