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/Timer/Code"

From A Tale in the Desert
Jump to navigationJump to search
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:
  
 
;Date: 5/29/2010
 
;Date: 5/29/2010
 +
;Last Update: 12/26/2010
 
;Author: Cegaiel
 
;Author: Cegaiel
  
Line 25: Line 26:
 
Gui, Destroy
 
Gui, Destroy
  
 
+
break = 0
 +
counter = 0
 
Total := Seconds + (Mins * 60)
 
Total := Seconds + (Mins * 60)
 
if (mode == "Teppy")
 
if (mode == "Teppy")
Total := Total * 1.07
+
Total := Total * 1.1
  
 
oMins := Mins
 
oMins := Mins
Line 46: Line 48:
  
 
;WinActivate, eGenesis Client
 
;WinActivate, eGenesis Client
 +
 +
  
 
KeyWait, NumpadAdd, D
 
KeyWait, NumpadAdd, D
 +
 +
#Persistent
 +
SetTimer, CheckNumPadMinus, 100
 +
  
  
 
Timer:
 
Timer:
 
+
counter ++
 
loop
 
loop
 
{
 
{
GetKeyState, state, NumpadSub
+
if break = 1
if state = D
 
 
{
 
{
 +
break := 0
 
break
 
break
 
}
 
}
  
GuiControl, Text, LocationText, HOLD Numpad Minus (--) to STOP Timer`n`nCurrent Timer: %minutes_eta%m %seconds_eta%s`n`nTimer Set: %oMins%m %oseconds%s (%mode% Time)`n`n
+
GuiControl, Text, LocationText, Press Numpad Minus (--) to STOP Timer`n`nCurrent Timer: %minutes_eta%m %seconds_eta%s`n`nTimer Set: %oMins%m %oseconds%s (%mode% Time)`nTimer Started: %counter% times
  
 
sleep 1000
 
sleep 1000
Line 87: Line 95:
  
  
GuiControl, Text, LocationText, Press Numpad Plus (+) key to START Timer`n`nCurrent Timer: %minutes_eta%m %seconds_eta%s`n`nTimer Set: %oMins%m %oseconds%s (%mode% Time)`n`nPress Ctrl+R to set a new time...
+
GuiControl, Text, LocationText, Press Numpad Plus (+) key to START Timer`n`nCurrent Timer: %minutes_eta%m %seconds_eta%s`n`nTimer Set: %oMins%m %oseconds%s (%mode% Time)`nTimer Started: %counter% times`nPress Ctrl+R to set new time/counter
  
  
Line 100: Line 108:
  
 
Gosub, Timer
 
Gosub, Timer
 +
 +
 +
 +
CheckNumPadMinus:
 +
 +
GetKeyState, state, NumpadSub
 +
if state = D
 +
break = 1
 +
return
 +
 +
  
 
^r::reload
 
^r::reload
 
</pre>
 
</pre>

Latest revision as of 02:12, 27 December 2010

;No hotkeys to start script. Upon loading script, it will immediately ask Seconds and Timing Mode.
;It will remember the seconds everytime you start / stop(reset) timer.
;Hit Ctrl+R if you want to reload script to input a new amount of seconds.

;Date: 5/29/2010
;Last Update: 12/26/2010
;Author: Cegaiel


	Gui, Add, Text,, Minutes:
	Gui, Add, Edit, vMins wp number, 0

	Gui, Add, Text,, Seconds:
	Gui, Add, Edit, vseconds wp number, 0

	Gui, Add, Text,, Timer Mode:
	Gui, Add, DropDownList, vmode Choose1, Real|Teppy
	Gui, Add, Button, gSubmit, Submit
	Gui, Show
	return


	Submit:
	Gui, Submit
	Gui, Destroy

	break = 0
	counter = 0
	Total := Seconds + (Mins * 60)
	if (mode == "Teppy")
	Total := Total * 1.1

	oMins := Mins
	oSeconds := Seconds

	Mins := Floor(Total/60)
	Seconds := Floor(Total - (Mins *60))

	minutes_eta := Mins
	seconds_eta := Seconds


	Gui, +AlwaysOnTop +ToolWindow
	Gui, Font, normal
	Gui, Add, Text, vLocationText, Press Numpad Plus (+) key to START Timer`n`nCurrent Timer: %Mins%m %seconds%s`n`nTimer Set: %oMins%m %oseconds%s (%mode% Time)`n`n
	Gui, Show

	;WinActivate, eGenesis Client



	KeyWait, NumpadAdd, D

	#Persistent 
	SetTimer, CheckNumPadMinus, 100



	Timer:
	counter ++
	loop
	{
		if break = 1
		{
		break := 0
		break
		}

	GuiControl, Text, LocationText, Press Numpad Minus (--) to STOP Timer`n`nCurrent Timer: %minutes_eta%m %seconds_eta%s`n`nTimer Set: %oMins%m %oseconds%s (%mode% Time)`nTimer Started: %counter% times

	sleep 1000
		
		if (seconds_eta = 0)
		{
		seconds_eta := 60
		minutes_eta --
		}
		
		if (minutes_eta < 0)
		minutes_eta := 0


		seconds_eta --
	

		if (minutes_eta = 0) and (seconds_eta = 0)
		break


	}


;occurs after the timer loop is broke 


	GuiControl, Text, LocationText, Press Numpad Plus (+) key to START Timer`n`nCurrent Timer: %minutes_eta%m %seconds_eta%s`n`nTimer Set: %oMins%m %oseconds%s (%mode% Time)`nTimer Started: %counter% times`nPress Ctrl+R to set new time/counter


	;reset counter time back to original
	minutes_eta := Mins
	seconds_eta := seconds

		SoundPlay *64,1

 
	KeyWait, NumpadAdd, D

	Gosub, Timer



	CheckNumPadMinus:

		GetKeyState, state, NumpadSub
		if state = D
		break = 1
	return



^r::reload