HD Scripts Posted June 22, 2012 Group: Members Topic Count: 23 Topics Per Day: 0.00 Content Count: 184 Reputation: 15 Joined: 06/10/12 Last Seen: Sunday at 10:55 PM Share Posted June 22, 2012 (edited) hello '-' I know how to put a time on a script ... I think it would be something like: OnPCLoginEvent: set minute,minute +1; dispbottom "Time logged: " + minute + " minute"; end; but this does not work, someone has an idea? Edited June 22, 2012 by Hurican Dooders Quote Link to comment Share on other sites More sharing options...
herenow Posted June 22, 2012 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 36 Reputation: 4 Joined: 02/12/12 Last Seen: January 25, 2017 Share Posted June 22, 2012 (edited) This o.O ? dispbottom "Logged in at: "+gettimestr("%Y-%m/%d &H:%M:%S", 21); @edit lol, nvm now i understood what you want.. function returnFormatTime { set .@remain_time,getarg(0); if(.@remain_time > 0) { set .@time[0],.@remain_time / 86400; set .@remain_time,.@remain_time % 86400; set .@time[1],.@remain_time / 3600; set .@remain_time,.@remain_time % 3600; set .@time[2],.@remain_time / 60; set .@remain_time,.@remain_time % 60; set .@time[3],.@remain_time; } return (.@time[0] ? .@time[0]+"day(s) " : "")+(.@time[1] ? .@time[1]+"hour(s) " : "")+(.@time[2] ? .@time[2]+"minute(s) " : "")+(.@time[3] ? .@time[3]+"second(s) " : ""); } OnPcLoginEvent: set @logged_in,gettimetick(3); if(loggedtime) { dispbottom "Logged in time: "+returnFormatTime(loggedtime); } OnPcLogoutEvent: set loggedtime, loggedtime + ( gettimetick(3) - @logged_in ); Try this. Edited June 22, 2012 by Tribbiani Quote Link to comment Share on other sites More sharing options...
HD Scripts Posted June 22, 2012 Group: Members Topic Count: 23 Topics Per Day: 0.00 Content Count: 184 Reputation: 15 Joined: 06/10/12 Last Seen: Sunday at 10:55 PM Author Share Posted June 22, 2012 (edited) i'm not in home, but i try this later thanks '-' @edit Error x.x' http://img542.imageshack.us/img542/2439/semttulojn.jpg Edited June 23, 2012 by Hurican Dooders Quote Link to comment Share on other sites More sharing options...
herenow Posted June 23, 2012 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 36 Reputation: 4 Joined: 02/12/12 Last Seen: January 25, 2017 Share Posted June 23, 2012 (edited) Did you add the tabs to the function? function<tab>returnFormatTime<tab>{ @edit Also add this.. I mean replace. OnPcLogoutEvent: if(@logged_in) { set loggedtime, loggedtime + ( gettimetick(3) - @logged_in ); } Edited June 23, 2012 by Tribbiani Quote Link to comment Share on other sites More sharing options...
HD Scripts Posted June 23, 2012 Group: Members Topic Count: 23 Topics Per Day: 0.00 Content Count: 184 Reputation: 15 Joined: 06/10/12 Last Seen: Sunday at 10:55 PM Author Share Posted June 23, 2012 (edited) cara, tu é brasileiro? O.O @edit if(Brasileiro) mes "Sim, coloquei as tabs corretamente..."; else yes, tabs added correctly Edited June 23, 2012 by Hurican Dooders Quote Link to comment Share on other sites More sharing options...
herenow Posted June 23, 2012 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 36 Reputation: 4 Joined: 02/12/12 Last Seen: January 25, 2017 Share Posted June 23, 2012 (edited) function returnFormatTime { set .@remain_time,getarg(0); if(.@remain_time > 0) { set .@time[0],.@remain_time / 86400; set .@remain_time,.@remain_time % 86400; set .@time[1],.@remain_time / 3600; set .@remain_time,.@remain_time % 3600; set .@time[2],.@remain_time / 60; set .@remain_time,.@remain_time % 60; set .@time[3],.@remain_time; } return (.@time[0] ? .@time[0]+"day(s) " : "")+(.@time[1] ? .@time[1]+"hour(s) " : "")+(.@time[2] ? .@time[2]+"minute(s) " : "")+(.@time[3] ? .@time[3]+"second(s) " : ""); } This function needs to be added inside the npc.. what i mean is.. you need to add this function inside the script. example: prontera,150,150,4<Tab>script<Tab>name<tab>849,{ function returnFormatTime { set .@remain_time,getarg(0); if(.@remain_time > 0) { set .@time[0],.@remain_time / 86400; set .@remain_time,.@remain_time % 86400; set .@time[1],.@remain_time / 3600; set .@remain_time,.@remain_time % 3600; set .@time[2],.@remain_time / 60; set .@remain_time,.@remain_time % 60; set .@time[3],.@remain_time; } return (.@time[0] ? .@time[0]+"day(s) " : "")+(.@time[1] ? .@time[1]+"hour(s) " : "")+(.@time[2] ? .@time[2]+"minute(s) " : "")+(.@time[3] ? .@time[3]+"second(s) " : ""); } OnPcLoginEvent: set @logged_in,gettimetick(3); if(loggedtime) { dispbottom "Logged in time: "+returnFormatTime(loggedtime); } OnPcLogoutEvent: if(@logged_in) { set loggedtime, loggedtime + ( gettimetick(3) - @logged_in ); } } Edited June 23, 2012 by Tribbiani Quote Link to comment Share on other sites More sharing options...
HD Scripts Posted June 23, 2012 Group: Members Topic Count: 23 Topics Per Day: 0.00 Content Count: 184 Reputation: 15 Joined: 06/10/12 Last Seen: Sunday at 10:55 PM Author Share Posted June 23, 2012 (edited) i go try this, edit here if not works '-' Ok, it works... I wanted to happen to that information every 1 minute in this case, placing a OnTimer60000: I tried this but no success;/ as it does? Edited June 23, 2012 by Hurican Dooders Quote Link to comment Share on other sites More sharing options...
Yanji Posted June 23, 2012 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 23 Reputation: 1 Joined: 06/22/12 Last Seen: October 5, 2012 Share Posted June 23, 2012 If you want it to tell the logged in time, maybe to update in the player's client every 5 minutes, you could do this: http://upaste.me/raw/e75e52836dc5ba1 Quote Link to comment Share on other sites More sharing options...
HD Scripts Posted June 23, 2012 Group: Members Topic Count: 23 Topics Per Day: 0.00 Content Count: 184 Reputation: 15 Joined: 06/10/12 Last Seen: Sunday at 10:55 PM Author Share Posted June 23, 2012 (edited) works... but tell: You have been logged in for 0 minutes. #edit I fixed it ... looked like this: - script Online1min -1,{ OnPCLoginEvent:X: sleep2 60000; set @loggedtime, @loggedtime + 1; set @logtimeupdate, @logtimeupdate + 1; if ( @logtimeupdate >= 1 ) { dispbottom "You have been logged in for " + @loggedtime + " minutes."; } goto X; end; OnPCLogoutEvent: set @logtimeupdate, 0; } operating at every 1 minute, and counting correctly. log out, resets the count and when log in again, begins to tell ... thanks man, helped me a lot. * ------ * and thanks to @ Tribbiani for the help too. can close Edited June 23, 2012 by Hurican Dooders Quote Link to comment Share on other sites More sharing options...
Yanji Posted June 23, 2012 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 23 Reputation: 1 Joined: 06/22/12 Last Seen: October 5, 2012 Share Posted June 23, 2012 (edited) You don't need to set it to 0 when logging out. It's a temporary character variable so it resets to nothing once your char is logged out. No problem btw, & sorry about the 0 minute thing xD (I wrote it in a minute) Edit: Fixed my font/color/ & size. Edited June 23, 2012 by Yanji Quote Link to comment Share on other sites More sharing options...
Question
HD Scripts
hello '-'
I know how to put a time on a script ...
I think it would be something like:
but this does not work, someone has an idea?
Edited by Hurican DoodersLink to comment
Share on other sites
9 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.