the code is the following:
in the profile
Code: Select all
<onLoad>
createTimer();
</onLoad>
<onLeaveCombat>
activateTimer();
</onLeaveCombat>Code: Select all
function changeChannel()
id = RoMScript("GetCurrentParallelID()");
if ( id == 1 ) then
RoMScript("ChangeParallelID(2)");
printf("Current Channel: 1 \n");
printf("Changing to Channel: 2 \n");
elseif ( id == 2 ) then
RoMScript("ChangeParallelID(3)");
printf("Current Channel: 2 \n");
printf("Changing to Channel 3 \n");
elseif ( id == 3 ) then
RoMScript("ChangeParallelID(1)");
printf("Current Channel: 3 \n");
printf("Changing to Channel 1 \n");
end;
yrest(10000);
end;
function activateTimer()
if( isTriggered("channelTimer") ) then
removeTimer("channelTimer");
newTimer("channelTimer");
startTimer("channelTimer", 7200000);
printf("Channel Timer loaded \n");
changeChannel();
end;
end;
function createTimer()
repeat
if( keyPressed( key.VK_F ) ) then
newTimer("channelTimer");
startTimer( "channelTimer", 7200000);
printf("Channel Timer loaded \n");
end;
until keyPressed( key.VK_F )
end;
detecting if the channel to wich is about to go is available, otherwise it could just end in the same channel
and probably intead of using newTimer, 'startTimer', 'removeTimer'. Just use 'registerTimer'
But the real problem is that the createTimer function, the loops that i've been trying to use like 'repeat' or 'registerTimer' just don't seem to work the way I want, and they stop the code execution with the loop.