Jump to content
  • 0
Sign in to follow this  
nana

announce rates

Question

How can i add to this script (sorry i'm a new scripter now TOT) that announce every hour the current rates after change

 

What i think i did was:

 

every monday at 00:00 i change rates all week for a random ones betwen 5x and 8x, then i reloadmobdb and finally i announce it...but i guess only happen once x_x

 

 

 

-	script	dynamic_exp	-1,{OnInit:OnHour00:	if( gettime(4) == 1 ) { // If its Monday		if( gettime(3) == 00) {			set $@brate,rand(500,800);			set $@jrate,rand(500,800);						//Base exp			setbattleflag("base_exp_rate",$@brate);			//Job exp			setbattleflag("job_exp_rate",$@jrate);						//we don't change card drops rate, because these values won't change them anyway			atcommand "@reloadmobdb";				announce "Current AkiaRO rates are: "+($@brate/100)+"x "+($@jrate/100)+"x ",bc_all,0xFF6060;					}	}} 

 

 
Thanks in advance ^^U

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

In fact, I'd have abused the OnMinute00 label adding an else announce "blahblahblah" after the first if gets closed, so that no timers are needed and it's more efficient solution :P

Share this post


Link to post
Share on other sites
  • 0

i have some troubles x_x

 

in the guide i saw this example

 

 

- script flood -1,{
OnInit:
    initnpctimer;
    end;
 
OnTimer40:
    announce "flood",bc_all,0xFF6060;
    setnpctimer, 0;
    end;
}

 

so i try use it for the script (i use the same structure)
 

 

- script flood -1,{
OnInit:
    initnpctimer;
    end;
 
OnTimer40:
    announce "the rates are 5x for all week",bc_all,0xFF6060;
    setnpctimer, 0;
    end;
}

 

 
 

 

however i got this error o.o
 
 
 
 
Error]: script error in file 'npc/dev/rates.txt' line 8 column 16
   parse_simpleexpr: unexpected end of expression
    5:
    6: OnTimer40:
    7:     announce "flood",bc_all,0xFF6060;
    8:     setnpctimer, 0;
       ~~~~~~~~~~~~~~~^
    9:     end;
   10: }
 
How can i solve this? o.o?

Share this post


Link to post
Share on other sites
  • 0

setnpctimer script command doesn't want you to put a comma before the first argument :)

setnpctimer <tick>{,"<NPC name>"};

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.