Jump to content
  • 0
Sign in to follow this  
ahmadshidqi

Need Help Daily Reward Auto Restart when 6Am

Question

Can you help me? i want to make a script.. "every 6am the script auto reset"

 

my script

 

-	script	dailyrewards	-1,{OnPCLoginEvent:getmapxy .@map$, .@x, .@y, 0;if ( .@map$=="invek" ) {if( #Daily != gettime(5) ){set .@point_amt, 25;set #CASHPOINTS, #CASHPOINTS + .@point_amt;dispbottom "Gained Daily Cash 25...";dispbottom "Current Balance = "+#CASHPOINTS+" Cashpoints";set #Daily,gettime(5);}}end;}
Edited by ahmadshidqi

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

fixed typo, try again

 

 

/*create table itemperacc (`account_id` int(11) unsigned NOT NULL primary key) engine = innodb;*/-	script	dailyrewards	-1,{OnPCLoginEvent:	getmapxy .@map$, .@x, .@y, 0; 	if ( .@map$=="invek" ) {		if ( !query_sql( "select account_id  from `itemperacc` where account_id ="+ getcharid(3) , .@acc ) ) {			set #CASHPOINTS, #CASHPOINTS + .@point_amt;			dispbottom "Gained Daily Cash 25...";			dispbottom "Current Balance = "+#CASHPOINTS+" Cashpoints";			 query_sql "insert into `itemperacc` values ( "+getcharid(3)+" )";		}	}	end;OnHour06:	query_sql "truncate itemperacc";	end;}

Share this post


Link to post
Share on other sites
  • 0

I wouldn't break my mind and simply use a SQL query:

 

-	script	dailyrewards	-1,{OnPCLoginEvent:	getmapxy .@map$, .@x, .@y, 0; 	if ( .@map$=="invek" ) {		if( #Daily != gettime(5) ) {			set .@point_amt, 25;			set #CASHPOINTS, #CASHPOINTS + .@point_amt;			dispbottom "Gained Daily Cash 25...";			dispbottom "Current Balance = "+#CASHPOINTS+" Cashpoints";			set #Daily,gettime(5);		}	} 	end;OnHour06:	query_sql("DELETE FROM `acc_reg_num_db` WHERE `key` = '#Daily'");	end;} 
 

Be warned I didn't test this script, so this may cause unwanted deletion of vars. Try it first on a test server with a backup of your DB.

Share this post


Link to post
Share on other sites
  • 0

 

I wouldn't break my mind and simply use a SQL query:

 

-	script	dailyrewards	-1,{OnPCLoginEvent:	getmapxy .@map$, .@x, .@y, 0; 	if ( .@map$=="invek" ) {		if( #Daily != gettime(5) ) {			set .@point_amt, 25;			set #CASHPOINTS, #CASHPOINTS + .@point_amt;			dispbottom "Gained Daily Cash 25...";			dispbottom "Current Balance = "+#CASHPOINTS+" Cashpoints";			set #Daily,gettime(5);		}	} 	end;OnHour06:	query_sql("DELETE FROM `acc_reg_num_db` WHERE `key` = '#Daily'");	end;} 
 

Be warned I didn't test this script, so this may cause unwanted deletion of vars. Try it first on a test server with a backup of your DB.

 

stil not worki sir :'(

Edited by ahmadshidqi

Share this post


Link to post
Share on other sites
  • 0

try this

/*create table itemperacc (`account_id` int(11) unsigned NOT NULL primary key) engine = innodb;*/-	script	dailyrewards	-1,{OnPCLoginEvent:	getmapxy .@map$, .@x, .@y, 0; 	if ( .@map$=="invek" ) {		if ( !query_sql( "select account_id  from `itemperacc` where account_id ="+ getcharid(3) , .@acc ) ) {			set #CASHPOINTS, #CASHPOINTS + .@point_amt;			dispbottom "Gained Daily Cash 25...";			dispbottom "Current Balance = "+#CASHPOINTS+" Cashpoints";			 query_sql "insert into `itemperacc` values ( "+getcharid(3)+" )";		}	}	end;OnHour06:	query_sql "truncate itemperacc";	end;}
Edited by Angelmelody

Share this post


Link to post
Share on other sites
  • 0

 

try this

 

/*create table itemperacc (`account_id` int(11) unsigned NOT NULL primary key) engine = innodb;*/-	script	dailyrewards	-1,{OnPCLoginEvent:	getmapxy .@map$, .@x, .@y, 0; 	if ( .@map$=="invek" ) {		if ( !query_sql( "select account_id  from `itemperacc` where account_id ="+ getcharid(3) +", .@acc ) ) {			set #CASHPOINTS, #CASHPOINTS + .@point_amt;			dispbottom "Gained Daily Cash 25...";			dispbottom "Current Balance = "+#CASHPOINTS+" Cashpoints";			 query_sql "insert into `itemperacc` values ( "+getcharid(3)+" )";		}	}	end;OnHour06:	query_sql "truncate itemperacc";	end;}

error script sir...

 

Untitled_zps4bfc866b.png

Share this post


Link to post
Share on other sites
  • 0

 

fixed typo, try again

 

 

/*create table itemperacc (`account_id` int(11) unsigned NOT NULL primary key) engine = innodb;*/-	script	dailyrewards	-1,{OnPCLoginEvent:	getmapxy .@map$, .@x, .@y, 0; 	if ( .@map$=="invek" ) {		if ( !query_sql( "select account_id  from `itemperacc` where account_id ="+ getcharid(3) , .@acc ) ) {			set #CASHPOINTS, #CASHPOINTS + .@point_amt;			dispbottom "Gained Daily Cash 25...";			dispbottom "Current Balance = "+#CASHPOINTS+" Cashpoints";			 query_sql "insert into `itemperacc` values ( "+getcharid(3)+" )";		}	}	end;OnHour06:	query_sql "truncate itemperacc";	end;}

thanks sir... after i test this script i report again ;)..

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.