Erba Posted September 10, 2013 Group: Members Topic Count: 84 Topics Per Day: 0.02 Content Count: 550 Reputation: 9 Joined: 11/06/12 Last Seen: August 14, 2014 Share Posted September 10, 2013 - script Hourly Active -1,{ OnUpdate: if( checkvending() == 0 || checkchatting() == 1 ){ set @Minute,@Minute + 1; if( @Minute % 30 == 0 ){ set #CASHPOINTS, #CASHPOINTS + 1; dispbottom "You've been Active for 30 minutes, +1 Cash point(s) in your Balance."; set @Hour,@Hour + 1; if( @Hour % 7 == 0 ){ set #CASHPOINTS, #CASHPOINTS + 10; getitem 14232,4; getitem 25138,10; dispbottom "You've been Actively Online for 7 Hours, +10 Cash point(s) in your Balance."; } } } else { if( checkvending() == 0 || checkchatting() == 0){ set @Minute,@Minute + 1; if( @Minute % 60 == 0 ){ set #CASHPOINTS, #CASHPOINTS + 2; // getitem 7227,1; dispbottom "You've Been AFK for 1 hour, +1 Cash point(s) in your Balance."; set @Hour,@Hour + 1; if( @Hour % 12 == 0 ){ set #CASHPOINTS, #CASHPOINTS + 10; // getitem 14232,10; // getitem 25138,10; dispbottom "You've Been AFK for 12 hours, +1 Cash point(s) in your Balance."; } } } } OnPCLoginEvent: addtimer 60000,strnpcinfo(0)+"::OnUpdate"; end; } My problem with this Hourly Points script that i am using .. made by sir Euphy i guess but i modified this for my server. this script should work like this: If a player is not vending and is chatting he will receive 1cash point every 30mins while the other one if a player is not vending and is afk he will receive 1cash point every 1 hour PROBLEM: still it gives vending player 1 cash points per hour even it is in normal vend or using autotrade.. please help Quote Link to comment Share on other sites More sharing options...
Patskie Posted September 10, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 10 hours ago Share Posted September 10, 2013 Try the following : 1. Change : if( checkvending() == 0 || checkchatting() == 1 ){ to : if( checkvending() == 0 && checkchatting() == 1 ){ since you said that player must not be in vending mode and must be in chat for 30 minutes to gain 1 cashpoint. 2. Change : } else { if( checkvending() == 0 || checkchatting() == 0){ set @Minute,@Minute + 1; if( @Minute % 60 == 0 ){ set #CASHPOINTS, #CASHPOINTS + 2; // getitem 7227,1; dispbottom "You've Been AFK for 1 hour, +1 Cash point(s) in your Balance."; set @Hour,@Hour + 1; if( @Hour % 12 == 0 ){ set #CASHPOINTS, #CASHPOINTS + 10; // getitem 14232,10; // getitem 25138,10; dispbottom "You've Been AFK for 12 hours, +1 Cash point(s) in your Balance."; } } } } to : } else if ( !checkvending() && checkidle() ) { set @Minute,@Minute + 1; if( @Minute % 60 == 0 ) { set #CASHPOINTS, #CASHPOINTS + 2; dispbottom "You've Been AFK for 1 hour, +1 Cash point(s) in your Balance."; set @Hour,@Hour + 1; if( @Hour % 12 == 0 ){ set #CASHPOINTS, #CASHPOINTS + 10; dispbottom "You've Been AFK for 12 hours, +1 Cash point(s) in your Balance."; } } } end; Quote Link to comment Share on other sites More sharing options...
GmOcean Posted September 10, 2013 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted September 10, 2013 Hmm, Patskie's fix should have done it, but am I missing something here? Why isn't @minute being reset? Also, in your first if( @minute % 30 ) statement, there isn't a check for whether or not @minute has reached 60, and instead gives the player +1 hour at 30mins... Quote Link to comment Share on other sites More sharing options...
Erba Posted September 10, 2013 Group: Members Topic Count: 84 Topics Per Day: 0.02 Content Count: 550 Reputation: 9 Joined: 11/06/12 Last Seen: August 14, 2014 Author Share Posted September 10, 2013 (edited) @patskie: thanks i forgot to use "&&" but i tried to use !checkvending() before but still gives player who are in vending mode with 1 point @lionhardt: can you be clarify your statement sir? im quite confused.. but anyway.. this is what i did.. i edited the first if(@minute % 30) so that player who is active [not vending but chatting] to gain 1 point per 30mins on the otherhand player who is [vending and is not chatting] will gaint 1point per 1hour Edited September 10, 2013 by Erba Quote Link to comment Share on other sites More sharing options...
GmOcean Posted September 10, 2013 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted September 10, 2013 I see, well perhaps you can post the Original Unaltered version of his script and we would further be able to help you. Quote Link to comment Share on other sites More sharing options...
Erba Posted September 10, 2013 Group: Members Topic Count: 84 Topics Per Day: 0.02 Content Count: 550 Reputation: 9 Joined: 11/06/12 Last Seen: August 14, 2014 Author Share Posted September 10, 2013 (edited) - script Hourly Points -1,{ OnUpdate: if( !checkvending() ){ set @Minute,@Minute + 1; if( @Minute % 60 == 0 ){ set #CASHPOINTS, #CASHPOINTS + 1; dispbottom "Online for 1 Hours +1 Cash Points."; set @Hour,@Hour + 1; if( @Hour % 12 == 0 ){ set #CASHPOINTS, #CASHPOINTS + 10; getitem 14232,10; dispbottom "Online for 12 Hours +10 Cash Points and 10pcs of Yggdrasil Berry Box."; } } } OnPCLoginEvent: addtimer 60000,strnpcinfo(0)+"::OnUpdate"; end; } @lionhardt: this one sir but this script doenst work.. still gives vending players.. @patskie: i got this error: Edited September 10, 2013 by Erba Quote Link to comment Share on other sites More sharing options...
GmOcean Posted September 10, 2013 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted September 10, 2013 Okay, well now I see why certain things are the way it is. Okay first things first. This is only for the every 30mins section. CHANGE: set @Hour,@Hour + 1; INTO: set @Thirty, @Thirty + 1; if( @Thirty == 2 ){set @Hour, @Hour + 1; set @Thirty,0;} Now LASTLY. I suggest you change all the variable in the every 60mins section to something else. For instance ' aMinute ' OR ' aHour '. This is because if a person, was to, be AFK for 29mins, and then start chatting, after 1min, it'll say 30mins. And then they'll get the 30minute points. So, if you change the name of the variables, they won't be able to do this. Essentially, a player will have to AFK for 60mins OR chat for 30mins. Not a mixture of both. Quote Link to comment Share on other sites More sharing options...
Erba Posted September 10, 2013 Group: Members Topic Count: 84 Topics Per Day: 0.02 Content Count: 550 Reputation: 9 Joined: 11/06/12 Last Seen: August 14, 2014 Author Share Posted September 10, 2013 - script Hourly Active -1,{ OnUpdate: if( checkvending() == 0 && checkchatting() == 1 ){ set @Minute,@Minute + 1; if( @Minute % 30 == 0 ){ set #CASHPOINTS, #CASHPOINTS + 1; dispbottom "You've been Active for 30 minutes, +1 Cash point(s) in your Balance."; set @Thirty,@Thirty + 1; if( @Thirty == 2 ){ set @hour, @Hour + 1; set @Thirty,0; } if( @Hour % 7 == 0 ){ set #CASHPOINTS, #CASHPOINTS + 10; getitem 14232,4; getitem 25138,10; dispbottom "You've been Actively Online for 7 Hours, +10 Cash point(s) in your Balance."; } } } else if( !checkvending() && checkchatting() == 0 ){ set @aMinute,@aMinute + 1; if( @aMinute % 60 == 0 ){ set #CASHPOINTS, #CASHPOINTS + 2; dispbottom "You've Been AFK for 1 hour, +1 Cash point(s) in your Balance."; set @aHour,@aHour + 1; if( @aHour % 12 == 0 ){ set #CASHPOINTS, #CASHPOINTS + 10; dispbottom "You've Been AFK for 12 hours, +1 Cash point(s) in your Balance."; } } } end; OnPCLoginEvent: addtimer 60000,strnpcinfo(0)+"::OnUpdate"; end; } Sir did i make it right? Quote Link to comment Share on other sites More sharing options...
GmOcean Posted September 10, 2013 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted September 10, 2013 yes Quote Link to comment Share on other sites More sharing options...
Erba Posted September 10, 2013 Group: Members Topic Count: 84 Topics Per Day: 0.02 Content Count: 550 Reputation: 9 Joined: 11/06/12 Last Seen: August 14, 2014 Author Share Posted September 10, 2013 ill try it for a while.. and report it back if it is working! thank you for the help patskie and lionhardt @bump The script doesnt have any errors but do not give points to players whether he is active or not Quote Link to comment Share on other sites More sharing options...
Question
Erba
My problem with this Hourly Points script that i am using .. made by sir Euphy i guess but i modified this for my server.
this script should work like this:
If a player is not vending and is chatting he will receive 1cash point every 30mins
while the other one
if a player is not vending and is afk he will receive 1cash point every 1 hour
PROBLEM:
still it gives vending player 1 cash points per hour even it is in normal vend or using autotrade..
please help
Link 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.