MicroByte
12-17-2009, 03:55 AM
well, not a plugin, thought id leave it for VIP to wrap :eek:
just a script, but im trying to show you budding plugin makers how easy it is to add real power to AMS with out externals, every thing you need is already on the system, use it!
AMSWaves Memory plugin is "The Best" plugin ever made, it opens so many doors, this timer script uses only 1 function from the plugin, so theres no excuses (im not good at code, bla bla bla)
-- declare event constants
WM_TIMER=275
-- define functions
function SetTimer(hWnd, nIDEvent, uElapse)
if tonumber(DLL.CallFunction("user32.dll", "SetTimer", hWnd..", "..nIDEvent..", "..uElapse..", 0", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)) == 0 then
return false
else
return true
end
end
function KillTimer(hWnd, nIDEvent)
if tonumber(DLL.CallFunction("user32.dll", "KillTimer", hWnd..", "..nIDEvent, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)) == 0 then
return false
else
return true
end
end
nACounter=0
nBCounter=0
-- define callback
function CallBack(hWnd, uMsg, wParam, lParam)
if uMsg == WM_TIMER then
local nTimerID=wParam
if nTimerID == 100 then
if nACounter == 10 then
KillTimer(hWnd, 100)
end
Label.SetText("Label1", "nTimerID = "..nTimerID.." - nCounter = "..nACounter)
nACounter=nACounter+1
else
if nBCounter == 10 then
KillTimer(hWnd, 200)
end
Label.SetText("Label2", "nTimerID = "..nTimerID.." - nCounter = "..nBCounter)
nBCounter=nBCounter+1
end
end
end
-- test
Memory.CreateWindowSubClass(Application.GetWndHand le(), 0, "CallBack");
SetTimer(Application.GetWndHandle(), 100, 1000)
SetTimer(Application.GetWndHandle(), 200, 100)
and there you have, unlimited multiple global timers for your apps (code took me 10 mins with 1 coffee break),
just a script, but im trying to show you budding plugin makers how easy it is to add real power to AMS with out externals, every thing you need is already on the system, use it!
AMSWaves Memory plugin is "The Best" plugin ever made, it opens so many doors, this timer script uses only 1 function from the plugin, so theres no excuses (im not good at code, bla bla bla)
-- declare event constants
WM_TIMER=275
-- define functions
function SetTimer(hWnd, nIDEvent, uElapse)
if tonumber(DLL.CallFunction("user32.dll", "SetTimer", hWnd..", "..nIDEvent..", "..uElapse..", 0", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)) == 0 then
return false
else
return true
end
end
function KillTimer(hWnd, nIDEvent)
if tonumber(DLL.CallFunction("user32.dll", "KillTimer", hWnd..", "..nIDEvent, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)) == 0 then
return false
else
return true
end
end
nACounter=0
nBCounter=0
-- define callback
function CallBack(hWnd, uMsg, wParam, lParam)
if uMsg == WM_TIMER then
local nTimerID=wParam
if nTimerID == 100 then
if nACounter == 10 then
KillTimer(hWnd, 100)
end
Label.SetText("Label1", "nTimerID = "..nTimerID.." - nCounter = "..nACounter)
nACounter=nACounter+1
else
if nBCounter == 10 then
KillTimer(hWnd, 200)
end
Label.SetText("Label2", "nTimerID = "..nTimerID.." - nCounter = "..nBCounter)
nBCounter=nBCounter+1
end
end
end
-- test
Memory.CreateWindowSubClass(Application.GetWndHand le(), 0, "CallBack");
SetTimer(Application.GetWndHandle(), 100, 1000)
SetTimer(Application.GetWndHandle(), 200, 100)
and there you have, unlimited multiple global timers for your apps (code took me 10 mins with 1 coffee break),