Dwnos01
Expired VIP Member
Posts: 20
Joined: Feb 2015
Reputation: 0
Version:
1.4.2.138
|
pause/unpause specifik script
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
|
|
04-20-2015 11:34 AM |
|
plixplox
Expired VIP Member
Posts: 304
Joined: Nov 2013
Reputation: 23
Version:
1.4.2.138
|
RE: pause/unpause specifik script
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 |
|
Dwnos01
Expired VIP Member
Posts: 20
Joined: Feb 2015
Reputation: 0
Version:
1.4.2.138
|
RE: pause/unpause specifik script
(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
|
|
04-20-2015 12:05 PM |
|
kerberos464
Bug revealer
Posts: 1,538
Joined: Jun 2012
Reputation: 576
Version:
1.4.3.143
|
RE: pause/unpause specifik script
you can't pause/resume scripts.
you only can start/stop them.
Everything is possible. The impossible just takes longer.
|
|
04-20-2015 12:06 PM |
|
plixplox
Expired VIP Member
Posts: 304
Joined: Nov 2013
Reputation: 23
Version:
1.4.2.138
|
RE: pause/unpause specifik script
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..
|
|
04-20-2015 12:17 PM |
|
kerberos464
Bug revealer
Posts: 1,538
Joined: Jun 2012
Reputation: 576
Version:
1.4.3.143
|
RE: pause/unpause specifik script
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;
Everything is possible. The impossible just takes longer.
(This post was last modified: 04-20-2015 12:25 PM by kerberos464.)
|
|
04-20-2015 12:24 PM |
|
Dwnos01
Expired VIP Member
Posts: 20
Joined: Feb 2015
Reputation: 0
Version:
1.4.2.138
|
RE: pause/unpause specifik script
(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
|
|
04-20-2015 13:57 PM |
|
kerberos464
Bug revealer
Posts: 1,538
Joined: Jun 2012
Reputation: 576
Version:
1.4.3.143
|
RE: pause/unpause specifik script
any code after this line:
until false
will never be executed.
Everything is possible. The impossible just takes longer.
|
|
04-20-2015 13:59 PM |
|
Dwnos01
Expired VIP Member
Posts: 20
Joined: Feb 2015
Reputation: 0
Version:
1.4.2.138
|
RE: pause/unpause specifik script
(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....
|
|
04-20-2015 14:10 PM |
|
plixplox
Expired VIP Member
Posts: 304
Joined: Nov 2013
Reputation: 23
Version:
1.4.2.138
|
RE: pause/unpause specifik script
maybe add to each section of your script when it process it,
ShowToClient("Section##","...Processing",3);
maybe help debug it for you..
|
|
04-20-2015 19:37 PM |
|