Setting up error handling for exp potions

mazz

Dedicated Member
Dedicated Member
Aug 6, 2008
193
2
45
Im trying to write a script that boosts the exp of the person who a expscroll.... not hard, but when i tryed to add in error handling so that u couldnt use more then 1 potion at a time it gets tricky... here is my code so far


Code:
[@StdModeFunc90]
#If
; If the current rate is => 150 then
NEED CHECKER HERE
#Act
LineMSG 6 "Exp potion is in use already
#ElseAct
LineMSG 6 "Exp multiplied X1.5 for 1 An Hour"
KILLMONEXPRATE 150 3600
break

Ive thought of trying to use a flag to tell me when 1 is in use but there is no way to know when or how to turn the flag off lol
ive tryed the command checkexp but i think it checks your total exp for your char instead. there has to be a command to check the current exprate
PLS HELP
 
Last edited:

12345678

Dedicated Member
Dedicated Member
Sep 1, 2004
163
0
42
Why wud u want it to not let them use another exppot while they are on one ?

If you use another exppot while on one, it cancles out the first one and starts the one you just used.
 
Upvote 0

mazz

Dedicated Member
Dedicated Member
Aug 6, 2008
193
2
45
Yeah I know im just making it so they dont waste a potion on accident this way it wont let u use 1 if you have used 1 already its mainly for daily boost and such so if you use your daily bonus then forget u did then use a exp potion it dont let u it would let you use it if it is better then what u are using atm. so you can only get better not worst
 
Last edited:
Upvote 0

mazz

Dedicated Member
Dedicated Member
Aug 6, 2008
193
2
45
Well here is what i came up with using flags
Code:
[@StdModeFunc90]
#If
CHECK [003] 0
#ACT
SET [003] 1
KILLMONEXPRATE 150 3600
LineMSG 6 "Exp multiplied X1.5 for 1 An Hour"
#ELSEACT
SET [003] 0
LineMSG 6 "Exp potion is in use already"
BREAK
It only stops you from using the item 1 time after that it works
 
Upvote 0

mStation

Golden Oldie
Golden Oldie
Oct 29, 2003
2,042
69
235
♫♪♫ ♦♥♠♣ ♀♂♀
but if you use the pot u get flag setted to 1 and if you use the time and the pots ends the effect you will still have the flag setted to 1 and if you try to drink again the pot you will get the messages saying you have used already the pot and will take the pot off anyway because you havent written to give it back.. at the same time if you use the pot for the first time it will set the flag at 1 then if you click again another pot with the same anicount it will say that you have already used it but will set back to 0 so that if you press the 3rd time it will be drank.. i think it needs some fixing to be perfect .. not so simply after all
 
Upvote 0

mazz

Dedicated Member
Dedicated Member
Aug 6, 2008
193
2
45
lmao only not simple because there are hardly any proper commands
If i was programming the server i may have more power to do these things lol
but im not so.... What they need to do is allow the creation of varitables to store data in. without a varitable or variant data type to use its alot harder.
since all they offer is the boolean data type true or false 1 or 0 theres not much to work with.


example

Code:
[@StdModeFunc90]
#If
CHECK [003] 0
[COLOR="Red"] varitable <= current server time and date ;is Less then or equal to the current server time and date + time added time [/COLOR] 
#ACT
SET [003] 1
KILLMONEXPRATE 150 3600
[COLOR="Red"]varitable = server time now and date + boost time(60 mins)[/COLOR] 
LineMSG 6 "Exp multiplied X1.5 for 1 An Hour"
#ELSEACT
SET [003] 0
LineMSG 6 "Exp potion is in use already"
BREAK

And of course with this ability i wouldnt even have to use the flag I would just check to see what time it is
Also i say server time because we all know what happens when you use the users system time, they just turn there clocks back lmao
 
Last edited:
Upvote 0