Currently Posted January 6, 2013 Group: Members Topic Count: 162 Topics Per Day: 0.03 Content Count: 313 Reputation: 1 Joined: 01/22/12 Last Seen: November 17, 2023 Share Posted January 6, 2013 If idle in lhz_dun04 for 1 minute. do @die. only in lhz_du04 Quote Link to comment Share on other sites More sharing options...
Capuche Posted January 9, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted January 9, 2013 If idle in lhz_dun04 for 1 minute. do @die. only in lhz_du04 - script lkjhgfd -1,{ OnPCLoadMapEvent: if( strcharinfo(3) == "lhz_dun04" ) { addtimer 30000, strnpcinfo(3)+"::On30secs"; @afkinbio4 = 0; } end; On30secs: if( strcharinfo(3) != "lhz_dun04" ) end; getmapxy .@mp$,.@x,.@y,0; if( .@x != @xbio4 || .@y != @ybio4 ) @afkinbio4 = 0; else if( @afkinbio4 == 3 ) percentheal -100,-100; @xbio4 = .@x; @ybio4 = .@y; @afkinbio4++; addtimer 30000, strnpcinfo(3)+"::On30secs"; end; } lhz_dun04 mapflag loadevent 1 Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted January 9, 2013 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted January 9, 2013 (edited) - script kjdshksdfjhsd -1,{ OnPCLoadMapEvent: if ( strcharinfo(3) != "lhz_dun04" ) end; while (1) { getmapxy .@map$, .@x, .@y, 0; if ( .@map$ != "lhz_dun04" ) end; else if ( .@x == .@afkinbio4_x && .@y == .@afkinbio4_y ) { .@afkinbio4++; // dispbottom "AFK for "+ .@afkinbio4 +" seconds"; if ( .@afkinbio4 == .afk ) { unitkill getcharid(3); end; } } else { // dispbottom "AFK reset"; .@afkinbio4 = 0; .@afkinbio4_map$ = .@map$; .@afkinbio4_x = .@x; .@afkinbio4_y = .@y; } sleep2 .sleeploop; } end; OnInit: .sleeploop = 1000; // every 1 second .afk = 60; // loop 60 times of 1 second == 1 minute end; } lhz_dun04 mapflag loadevent huhuhu ... its fun when I have a challenger xD EDIT: addtimer 30000, strnpcinfo(3)+"::On30secs"; ..... else if( @afkinbio4 == 3 ) ..... @afkinbio4++; I believe it should be @afkinbio4 == 2 there because @afkinbio4++ is execute later either put @afkinbio4++ before the execution of that condition to make it 3, or put it later to make it 2 Edited January 9, 2013 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
GM Takumirai Posted January 9, 2013 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 592 Reputation: 31 Joined: 11/14/11 Last Seen: July 29, 2015 Share Posted January 9, 2013 Hi annie miss u Quote Link to comment Share on other sites More sharing options...
Capuche Posted January 9, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted January 9, 2013 (edited) Challenge accepted ! So as a challenger, I will comment your script XD Let's go : .@map$ = "lhz_dun04"; while ( .@map$ == "lhz_dun04" ) { I think this condition will ALWAYS be true lol. Well it works, why not if ( .@afkinbio4 == .afk ) { unitkill getcharid(3); end; } It means the loop will end here. If the player revive (resurrection skill or else), he should walk wherever he wants and afk without any risk ! Also we both do a mistake : if the player use teleport in the same map, the server will create multi instance/loop without any restriction. I believe it should be @afkinbio4 == 2 there because @afkinbio4++ is execute later either put @afkinbio4++ before the execution of that condition to make it 3, or put it later to make it 2 In the beginning of the loop, it's true that there are 4 loops before dying. After that, it's one minute (it's a bit screw up I know - and my explanation...). Edit : You're right >.< Here my script after correction - script lkjhgfd -1,{ OnPCLoadMapEvent: if( strcharinfo(3) == "lhz_dun04" && !@afkinbio4 ) { addtimer 30000, strnpcinfo(3)+"::On30secs"; @afkinbio4 = 1; getmapxy .@map$,.@x,.@y,0; @afkinbio4_x = .@x; @afkinbio4_y = .@y; } end; On30secs: // dispbottom ""+gettime(1); if( strcharinfo(3) != "lhz_dun04" ) { @afkinbio4 = 0; end; } @afkinbio4++; getmapxy .@map$,.@x,.@y,0; if( .@x != @afkinbio4_x || .@y != @afkinbio4_y ) @afkinbio4 = 0; else if( @afkinbio4 == 3 ) percentheal -100,-100; @afkinbio4_x = .@x; @afkinbio4_y = .@y; addtimer 30000, strnpcinfo(3)+"::On30secs"; end; } lhz_dun04 mapflag loadevent Edited January 9, 2013 by Capuche 1 Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted January 9, 2013 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted January 9, 2013 wahahaha XD its been awhile someone wants to play with me like this XD you are right about teleport/ressurection I've forgotten this map doesn't have nowarp/nowarpto/noteleport/nosave mapflag -> its a non-event map so here I try again XD - script kjdshksdfjhsd -1,{ OnPCLoadMapEvent: if ( strcharinfo(3) != "lhz_dun04" || @afkinbio4_start ) end; @afkinbio4_start = 1; OnLoop: while (1) { getmapxy .@map$, .@x, .@y, 0; if ( .@map$ != "lhz_dun04" ) break; else if ( .@x != .@afkinbio4_x || .@y != .@afkinbio4_y || !hp ) { dispbottom "AFK reset"; .@afkinbio4 = 0; .@afkinbio4_map$ = .@map$; .@afkinbio4_x = .@x; .@afkinbio4_y = .@y; } else if ( .@x == .@afkinbio4_x && .@y == .@afkinbio4_y ) { .@afkinbio4++; dispbottom "AFK for "+ .@afkinbio4 +" seconds"; if ( .@afkinbio4 == .afk ) { addtimer .sleeploop, strnpcinfo(0)+"::OnLoop"; // when you die on 1st time, the script execution ends unitkill getcharid(3); end; // doesn't read here on 1st death } } sleep2 .sleeploop; } @afkinbio4_start = 0; end; OnInit: .sleeploop = 1000; // every 1 second .afk = 60; // loop 60 times of 1 second == 1 minute end; } lhz_dun04 mapflag loadevent btw your script - script lkjhgfd -1,{ OnPCLoadMapEvent: if( strcharinfo(3) == "lhz_dun04" && !@afkinbio4 ) { addtimer 1000, strnpcinfo(3)+"::On30secs"; @afkinbio4 = 1; getmapxy .@map$,.@x,.@y,0; @afkinbio4_x = .@x; @afkinbio4_y = .@y; } end; On30secs: // dispbottom ""+gettime(1); if( strcharinfo(3) != "lhz_dun04" ) { @afkinbio4 = 0; end; } @afkinbio4++; // dispbottom "AFK for "+ @afkinbio4 +" seconds"; // <-- after you die, this message isn't execute getmapxy .@map$,.@x,.@y,0; if( .@x != @afkinbio4_x || .@y != @afkinbio4_y ) @afkinbio4 = 0; else if( @afkinbio4 == 5 ) percentheal -100,-100; @afkinbio4_x = .@x; @afkinbio4_y = .@y; addtimer 1000, strnpcinfo(3)+"::On30secs"; end; } lhz_dun04 mapflag loadevent there is an intended bug in SVN when you die, the script execute is forced to end it is an intended behavior so when the player die cannot talk to npc anymore in other words if you are ressurected (@alive), they can afk for as long as they want with your script Quote Link to comment Share on other sites More sharing options...
Ajjwidjdneidjenw Posted January 9, 2013 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 161 Reputation: 31 Joined: 12/06/11 Last Seen: December 25, 2022 Share Posted January 9, 2013 Doesn't the script terminate when the user uses a flywing? Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted January 9, 2013 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted January 9, 2013 nope, if the user use wing of fly or teleportation skill ( acolyte skill or from skill given by creamy card ) the coordinate of the user will change, the script will continue execute as player has walk Quote Link to comment Share on other sites More sharing options...
Ajjwidjdneidjenw Posted January 9, 2013 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 161 Reputation: 31 Joined: 12/06/11 Last Seen: December 25, 2022 Share Posted January 9, 2013 (edited) Ah, I thought the script end upon warp, but I suppose that only applies with the script warp command. Anyway, isn't it much much easier to just warp the character to town? aside from being able to get ressurected . Edited January 9, 2013 by Jeroen Quote Link to comment Share on other sites More sharing options...
Capuche Posted January 9, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted January 9, 2013 there is an intended bug in SVN when you die, the script execute is forced to end it is an intended behavior so when the player die cannot talk to npc anymore in other words if you are ressurected (@alive), they can afk for as long as they want with your script You're right ! I make the script with an old version (~r16820), the script didn't stop so I didn't see that. I forgot it works like that in new version. Well I have nothing to complain about your script this time Anyway, isn't it much much easier to just warp the character to town? aside from being able to get ressurected . Why make things easy ? XD 1 Quote Link to comment Share on other sites More sharing options...
Currently Posted January 11, 2013 Group: Members Topic Count: 162 Topics Per Day: 0.03 Content Count: 313 Reputation: 1 Joined: 01/22/12 Last Seen: November 17, 2023 Author Share Posted January 11, 2013 How about idle for 10 seconds, what should i edit? Quote Link to comment Share on other sites More sharing options...
Capuche Posted January 11, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted January 11, 2013 You must edit .afk .afk = 60; // loop 60 times of 1 second == 1 minute Quote Link to comment Share on other sites More sharing options...
Emistry Posted January 12, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted January 12, 2013 * wild @Emistry appeared * xD how about this ? http://pastebin.com/raw.php?i=eSiCfiq7 Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted January 13, 2013 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted January 13, 2013 * wild @Emistry appeared * xD how about this ? http://pastebin.com/raw.php?i=eSiCfiq7 your script will spam the error multiple time according to the times that you have teleport try @load multiple times and wait for 60 seconds after that Quote Link to comment Share on other sites More sharing options...
Question
Currently
If idle in lhz_dun04 for 1 minute. do @die. only in lhz_du04
Link to comment
Share on other sites
13 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.