Lineage 2 Tower Forum

Full Version: pause/unpause specifik script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi
is possible to pause /unpause a script by using another script?
i tried use ProcessCommand("/scriptStop xxx.lua")
but when i start it script is restarting
any help is welcome thnks
How u need it to pause?
If by like going to town, you can set it to if zone type = XX then setpause
If you need it to move spots by hunting, then I you add to script If isPaused().
(04-20-2015 11:52 AM)plixplox Wrote: [ -> ]How u need it to pause?
If by like going to town, you can set it to if zone type = XX then setpause
If you need it to move spots by hunting, then I you add to script If isPaused().

I run 2 scripts ..example ...xxx.lua and the xxx2.lua
using xxx.lua i stop or start the xxx2.lua by using
ProcessCommand("/scriptStop xxx2.lua") or
ProcessCommand("/scriptStart xxx2.lua")
.. but when i use it it restarting the script .. if its path points its goes to first one... that why i want some help or ideas
ty Smile
you can't pause/resume scripts.
you only can start/stop them.
It would prolly be a lot work, but maybe function for get location < XXX to nearest point..
Then have to start of each move section to allow script to resume from nearest point..
i think you don't need to use 2 scripts for that.
use following structure:

    LUA Programming
function Part1()
 ...
end;
 
function Part2()
 ...
end;
 
repeat
 if GetMe():GetRangeTo(x1, y1, z1) < 500 then
 Part1();
 elseif GetMe():GetRangeTo(x2, y2, z2) < 500 then
 Part2();
 end;
 Sleep(1000);
until false;

(04-20-2015 12:24 PM)kerberos464 Wrote: [ -> ]i think you don't need to use 2 scripts for that.
use following structure:

    LUA Programming
function Part1()
 ...
end;
 
function Part2()
 ...
end;
 
repeat
 if GetMe():GetRangeTo(x1, y1, z1) < 500 then
 Part1();
 elseif GetMe():GetRangeTo(x2, y2, z2) < 500 then
 Part2();
 end;
 Sleep(1000);
until false;


i try that like this
repeat
if GetTarget() ~= nil then
Part1();
end
until false
repeat
if GetTarget() == nil then
Part2();
end;
until false

if i put at part1 the main function that i want and part2 some points
it move ok but part1 runs only 1 times until it moves to all points.. something i do wrong
ty
any code after this line:
until false

will never be executed.
(04-20-2015 13:59 PM)kerberos464 Wrote: [ -> ]any code after this line:
until false

will never be executed.
yes you are right was doing some test.. i use this
repeat
if GetTarget() ~= nil then
Part1();
end
if GetTarget() == nil then
Part2();
end;
until false;

when i start the script if i take myself target it tries to cast skill...that happend at first 1-3 sec... if i let it start moving and then target manual my self nothing happend.. that means that the repeat doest work...it work only at start.. but the path points work fine... and i havent any error....
maybe add to each section of your script when it process it,
ShowToClient("Section##","...Processing",3);

maybe help debug it for you..
Reference URL's