L2Tower Discord Let's keep the community alive with discord. Discussions about plugins and scripts L2Tower Discord

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pause/unpause specifik script
Author Message
Dwnos01 Offline
Expired VIP Member
**

Posts: 20
Joined: Feb 2015
Reputation: 0
Version: 1.4.2.138
Post: #1
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
Find all posts by this user Quote this message in a reply
plixplox Offline
Expired VIP Member
**

Posts: 304
Joined: Nov 2013
Reputation: 23
Version: 1.4.2.138
Post: #2
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
Find all posts by this user Quote this message in a reply
Dwnos01 Offline
Expired VIP Member
**

Posts: 20
Joined: Feb 2015
Reputation: 0
Version: 1.4.2.138
Post: #3
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 Smile
04-20-2015 12:05 PM
Find all posts by this user Quote this message in a reply
kerberos464 Offline
Bug revealer

Posts: 1,538
Joined: Jun 2012
Reputation: 576
Version: 1.4.3.143
Post: #4
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
Visit this user's website Find all posts by this user Quote this message in a reply
plixplox Offline
Expired VIP Member
**

Posts: 304
Joined: Nov 2013
Reputation: 23
Version: 1.4.2.138
Post: #5
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
Find all posts by this user Quote this message in a reply
kerberos464 Offline
Bug revealer

Posts: 1,538
Joined: Jun 2012
Reputation: 576
Version: 1.4.3.143
Post: #6
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
Visit this user's website Find all posts by this user Quote this message in a reply
Dwnos01 Offline
Expired VIP Member
**

Posts: 20
Joined: Feb 2015
Reputation: 0
Version: 1.4.2.138
Post: #7
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
Find all posts by this user Quote this message in a reply
kerberos464 Offline
Bug revealer

Posts: 1,538
Joined: Jun 2012
Reputation: 576
Version: 1.4.3.143
Post: #8
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
Visit this user's website Find all posts by this user Quote this message in a reply
Dwnos01 Offline
Expired VIP Member
**

Posts: 20
Joined: Feb 2015
Reputation: 0
Version: 1.4.2.138
Post: #9
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
Find all posts by this user Quote this message in a reply
plixplox Offline
Expired VIP Member
**

Posts: 304
Joined: Nov 2013
Reputation: 23
Version: 1.4.2.138
Post: #10
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
Find all posts by this user Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
Information Pause with 1 click, Events Sh4d0W 2 2,406 06-27-2014 21:09 PM
Last Post: Sh4d0W
  Pause in all windows Lordbl4 5 4,281 01-12-2014 12:02 PM
Last Post: Lordbl4
  pause hotkey zosiek 6 5,525 01-02-2013 11:25 AM
Last Post: Mobius
  my char can be BAN with L2tower mode "pause ON" renato_jose 7 6,061 10-13-2012 23:33 PM
Last Post: TheBl4ckPhoenix



User(s) browsing this thread: 1 Guest(s)