announce rates

nana

New member
Messages
67
Points
0
Location
Mexico
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

Code:
-	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
 
To give you a wider idea about timer.. please read [WIKI]Timers (Scripting)..

Explore and play with it
default_smile.png


 
Last edited by a moderator:
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
default_tongue.png


 
Last edited by a moderator:
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?

 
setnpctimer script command doesn't want you to put a comma before the first argument
default_smile.png


Code:
setnpctimer <tick>{,"<NPC name>"};
 
Back
Top