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
Line 13: Line 13:
  
 
Gui, Add, Text,, Timer Mode:
 
Gui, Add, Text,, Timer Mode:
Gui, Add, DropDownList, vmode Choose1, Teppy|Real
+
Gui, Add, DropDownList, vmode Choose1, Real|Teppy
 
Gui, Add, Button, gSubmit, Submit
 
Gui, Add, Button, gSubmit, Submit
 
Gui, Show
 
Gui, Show
Line 23: Line 23:
 
Gui, Destroy
 
Gui, Destroy
  
Minutes := Mins * 60
+
 
Seconds := Minutes + Seconds
+
Total := Seconds + (Mins * 60)
 +
if (mode == "Teppy")
 +
Total := Total * 1.07
 +
 
  
 +
 +
Mins := Floor(Total/60)
 +
Seconds := Floor(Total - (Mins *60))
 +
 +
minutes_eta := Mins
 +
seconds_eta := Seconds
  
  
 
Gui, +AlwaysOnTop +ToolWindow
 
Gui, +AlwaysOnTop +ToolWindow
 
Gui, Font, normal
 
Gui, Font, normal
Gui, Add, Text, vLocationText, Press Numpad Plus (+) key to START Timer`n`nTimer Set: %seconds% (%mode%) seconds`n`n
+
Gui, Add, Text, vLocationText, Press Numpad Plus (+) key to START Timer`n`nCurrent Timer: %Mins%m %seconds%s`n`nTimer Set: %Mins%m %seconds%s (%mode% Time)`n`n
 
Gui, Show
 
Gui, Show
  
Line 39: Line 48:
  
 
Timer:
 
Timer:
counter := seconds * 10
 
 
if (mode == "Teppy")
 
;If use the multiplier of 1.1 because 1 teppy minute = about 1m 06 seconds. 60 seconds times 1.1 is 1:06
 
counter := counter * 1.1
 
  
 
loop
 
loop
Line 50: Line 54:
 
if state = D
 
if state = D
 
{
 
{
counter := counter/10
 
 
break
 
break
 
}
 
}
if counter <= 0  
+
 
 +
GuiControl, Text, LocationText, HOLD Numpad Minus (--) to STOP Timer`n`nCurrent Timer: %minutes_eta%m %seconds_eta%s`n`nTimer Set: %Mins%m %seconds%s (%mode% Time)`n`n
 +
 
 +
sleep 1000
 +
 +
if (seconds_eta = 0)
 
{
 
{
SoundPlay *64,1
+
seconds_eta := 60
 +
minutes_eta --
 +
}
 +
 +
if (minutes_eta < 0)
 +
minutes_eta := 0
 +
 
 +
 
 +
seconds_eta --
 +
 +
 
 +
if (minutes_eta = 0) and (seconds_eta = 0)
 
break
 
break
}
 
  
counter--
+
 
Display := counter/10
 
SetFormat, float, 0.1
 
GuiControl, Text, LocationText, Press Numpad Minus (--) to STOP Timer`n`nTimer Set: %seconds% (%mode%) seconds`n`n%display% seconds remaining...
 
sleep 100
 
 
}
 
}
  
  
+
;occurs after the timer loop is broke
GuiControl, Text, LocationText, Press Numpad Plus (+) key to START Timer`n`nTimer Set: %seconds% (%mode%) seconds`n`n%display% seconds remaining...
+
 
 +
 
 +
GuiControl, Text, LocationText, Press Numpad Plus (+) key to START Timer`n`nCurrent Timer: %minutes_eta%m %seconds_eta%s`n`nTimer Set: %Mins%m %seconds%s (%mode% Time)`n`nPress Ctrl+R to set a new time...
 +
 
 +
 
 +
;reset counter time back to original
 +
minutes_eta := Mins
 +
seconds_eta := seconds
 +
 
 +
SoundPlay *64,1
  
 
   
 
   
Line 76: Line 99:
  
 
^r::reload
 
^r::reload
 +
 
</pre>
 
</pre>

Revision as of 00:56, 30 May 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.



	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


	Total := Seconds + (Mins * 60)
	if (mode == "Teppy")
	Total := Total * 1.07



	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: %Mins%m %seconds%s (%mode% Time)`n`n
	Gui, Show

	;WinActivate, eGenesis Client

	KeyWait, NumpadAdd, D


	Timer:

	loop
	{
		GetKeyState, state, NumpadSub
		if state = D
		{
		break
		}

	GuiControl, Text, LocationText, HOLD Numpad Minus (--) to STOP Timer`n`nCurrent Timer: %minutes_eta%m %seconds_eta%s`n`nTimer Set: %Mins%m %seconds%s (%mode% Time)`n`n

	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: %Mins%m %seconds%s (%mode% Time)`n`nPress Ctrl+R to set a new time...


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

		SoundPlay *64,1

 
	KeyWait, NumpadAdd, D

	Gosub, Timer

^r::reload