The Wiki for Tale 4 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.

If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.

Difference between revisions of "User:Cegaiel/Macros/StopWatch/Code"

From A Tale in the Desert
Jump to navigationJump to search
Line 1: Line 1:
 
<pre>
 
<pre>
counter = 0  
+
;No hotkeys to start script, will begin immediately and show GUI menu
 +
 
 +
Seconds = 0
 +
 
 +
 
 +
 
  
Gui, -Destroy
 
 
Gui, +AlwaysOnTop +ToolWindow
 
Gui, +AlwaysOnTop +ToolWindow
 
Gui, Font, normal
 
Gui, Font, normal
Gui, Add, Text, vLocationText, Start Timer: NumPad (+) , Stop Timer: Numpad (-)`n`n
+
Gui, Add, Text, vLocationText, Press Numpad Plus (+) key to START Timer`n`n
 
Gui, Show
 
Gui, Show
  
KeyWait, NumpadAdd, D
+
;WinActivate, eGenesis Client
 +
 
 +
KeyWait, NumpadAdd, D
 +
 
 +
 
 +
Timer:
 +
counter := seconds * 10
 +
 
 +
 
 +
loop
 +
{
 +
GetKeyState, state, NumpadSub
 +
if state = D
 +
{
 +
counter := counter/10
 +
break
 +
}
 +
 
  
loop
 
{
 
GetKeyState, state, NumpadSub
 
if state = D
 
{
 
counter := counter/10
 
break
 
}
 
 
counter++
 
counter++
 
Display := counter/10
 
Display := counter/10
 
SetFormat, float, 0.1  
 
SetFormat, float, 0.1  
GuiControl, Text, LocationText, %Display% seconds has elapsed...`n`nPress Numpad Minus (-) to STOP  timer
+
GuiControl, Text, LocationText, Press Numpad Minus (--) to STOP Timer`n`n%Display% seconds elapsed...  
 
sleep 100
 
sleep 100
}
+
}
 +
 
  
 +
 +
GuiControl, Text, LocationText, Press Numpad Plus (+) key to START Timer`n`n
  
GuiControl, Text, LocationText, %Display% seconds has elapsed...`n`n Press <Spacebar> to clear/reset timer
+
 +
KeyWait, NumpadAdd, D
  
 +
;counter := seconds * 1.1 * 10
 +
Gosub, Timer
  
KeyWait, Space, D
+
^r::reload
if ErrorLevel = 0
 
{
 
Reload
 
}
 
 
</pre>
 
</pre>

Revision as of 04:56, 18 February 2010

;No hotkeys to start script, will begin immediately and show GUI menu 

Seconds = 0




	Gui, +AlwaysOnTop +ToolWindow
	Gui, Font, normal
	Gui, Add, Text, vLocationText, Press Numpad Plus (+) key to START Timer`n`n
	Gui, Show

	;WinActivate, eGenesis Client

	KeyWait, NumpadAdd, D


	Timer:
	counter := seconds * 10


	loop
	{
		GetKeyState, state, NumpadSub
		if state = D
		{
		counter := counter/10
		break
		}


	counter++
	Display := counter/10
	SetFormat, float, 0.1 
	GuiControl, Text, LocationText, Press Numpad Minus (--) to STOP Timer`n`n%Display% seconds elapsed... 
	sleep 100
	}


	
	GuiControl, Text, LocationText, Press Numpad Plus (+) key to START Timer`n`n 

 
	KeyWait, NumpadAdd, D

	;counter := seconds * 1.1 * 10
	Gosub, Timer

^r::reload