Jump to content
  • 0

R > Random Floating Exp


Guih

Question


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/25/12
  • Last Seen:  

Hello everyone!

 

I'd like to request a script that can change the base and job rates every 2 hours. But that change would be random.

My current rates are 10x/10x and I'd like that rate to be changed to 10x/10x (keep current rate), 15x/15x, 20x/20x, 25x/25x, 30x/30x, 35x/35x and 40x/40x.

The value would be random every two hours.

 

Is that possible?

 

Thank you very much!

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Not tested

- script FloatingExp -1,{
OnMinute00:
if ( gettime( 3 ) % 2 ) end;
setarray .@i[ 0 ], 10, 15, 20, 25, 30, 35, 40;
.@a = .@i[ rand( getarraysize( .@i ) ) ];
setbattleflag "base_exp_rate", .@a;
setbattleflag "job_exp_rate", .@a;
end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/25/12
  • Last Seen:  

 

Oh thanks, but that one doesn't change the rates randomly.

 

 

Not tested

- script FloatingExp -1,{
OnMinute00:
if ( gettime( 3 ) % 2 ) end;
setarray .@i[ 0 ], 10, 15, 20, 25, 30, 35, 40;
.@a = .@i[ rand( getarraysize( .@i ) ) ];
setbattleflag "base_exp_rate", .@a;
setbattleflag "job_exp_rate", .@a;
end;
}

 

I'm going to try this one, thanks to both of you!

Okay, it's working perfectly. I had to modify it for:

-	script	FloatingExp	-1,{
OnMinute00:
if ( gettime( 3 ) % 2 ) end;
setarray .@i[ 0 ], 1000, 1500, 2000, 2500, 3000, 3500, 4000;
.@a = .@i[ rand( getarraysize( .@i ) ) ];
setbattleflag "base_exp_rate", .@a;
setbattleflag "job_exp_rate", .@a;
announce  "Floating Rate: The base and job rates were changed to "+.@a+"x/"+.@a+"x! Enjoy it!",bc_all,0xCC33B3;
end;
}

The only problem now is that the announcement gives me, e.g.: "2000x/2000x", is that any way I can change it to show 20x?

Edited by Guih
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

setarray .@i[ 0 ], 1000, 1500, 2000, 2500, 3000, 3500, 4000;

This array holds the values that will be randomly selected as rates. Change the numbers to change what the rates will be.

 

Side note: What is j.@a in your announce line? Is that a typo?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/25/12
  • Last Seen:  

setarray .@i[ 0 ], 1000, 1500, 2000, 2500, 3000, 3500, 4000;

This array holds the values that will be randomly selected as rates. Change the numbers to change what the rates will be.

 

Side note: What is j.@a in your announce line? Is that a typo?

 

 

Yeah it was a typo, sorry.

 

I can't change that value. If i change it to 10,15,20... The emulator reads it as 0.10, 0.15, 0.20x...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

Use your math skills here.

 

If 10 = 0.10, then it's clearly the value you specify divided by 100.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/25/12
  • Last Seen:  

I already worked it out using if statements.

 

Thanks ;)

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...