Math.Rand?

Need help running MacroQuest2? Ask your questions about how to get things to work on your computer.

Moderator: MacroQuest Developers

OBCENEIKON
decaying skeleton
decaying skeleton
Posts: 9
Joined: Thu May 27, 2004 12:40 pm

Math.Rand?

Post by OBCENEIKON » Fri Oct 22, 2004 3:51 am

I am trying to generate a number between 100 and 400, I found this in the manual
Math
math Math

access to type(s): math

Creates a Math object which gives allows access to the math type members.
Example

/echo ${Math.Sqrt[49]}
Echos the square root of 49

/echo ${Math.Rand[500]}
Echos a random number between 0 and 500

/echo ${Math.Calc[49%6+25]}
Echos the result of 49%6+25, or 1+25
but didnt see anything to get a number between 2 givin numbers. is there a way to do this?

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Fri Oct 22, 2004 4:21 am

/echo ${Math.Calc[${Math.Rand[300]}+100]}

Sharp of Fairlight
VIP=Very Impressive Pimpin'
Posts: 108
Joined: Wed Oct 29, 2003 3:54 pm
Location: Sweden

Post by Sharp of Fairlight » Fri Oct 22, 2004 5:54 am

Hi.

I usually back out of my garage with my car but yesterday a friend of mine borrowed my car and returned it with the front towards the garage door. I need help with getting out of the garage. Is there a way to do this?

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Fri Oct 22, 2004 6:13 am

Damn you Sharp...I think i just bit my tongue. :(

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Fri Oct 22, 2004 9:38 am

DKAA getting soft on us :D

OBCENEIKON
decaying skeleton
decaying skeleton
Posts: 9
Joined: Thu May 27, 2004 12:40 pm

Post by OBCENEIKON » Fri Oct 22, 2004 9:39 am

damn, read the manual, searched the boards, and still get flamed, its a no win situation. BTW thanks DKAA
Last edited by OBCENEIKON on Fri Oct 22, 2004 9:39 am, edited 1 time in total.

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Fri Oct 22, 2004 9:39 am

Yes sharp, just drop a stick of Dynamite in the gas tank and blow it out. Will work, guranteed. :P
OBCENEIKON wrote:damn, read the manual, searched the boards, and still get flamed, its a no win situation.
Lolz. There are no instructions for tying your shoes in the manual either, but if you ask on here, yea you will prolly get flamed. Think thats the point Sharp was making.

Asking how to add 2 numbers together is kinda in the "shoe lace" category.

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Fri Oct 22, 2004 10:51 am

Reading the manual and searching the boards is all good but there's a third step you forgot. Thinking.. ;)

User avatar
TheUnholy
a hill giant
a hill giant
Posts: 269
Joined: Wed Mar 03, 2004 11:59 pm

Post by TheUnholy » Fri Oct 22, 2004 8:50 pm

Sharp of Fairlight wrote:Hi.

I usually back out of my garage with my car but yesterday a friend of mine borrowed my car and returned it with the front towards the garage door. I need help with getting out of the garage. Is there a way to do this?
hahahahahahaha

Cams69
orc pawn
orc pawn
Posts: 20
Joined: Sat Sep 25, 2004 10:27 am

Post by Cams69 » Fri Oct 22, 2004 11:57 pm

Need the MQ2GarageDoor plugin !

Jerle69
a hill giant
a hill giant
Posts: 263
Joined: Wed Apr 28, 2004 3:26 pm

Post by Jerle69 » Sat Oct 23, 2004 9:52 am

HAHA, great laugh Sharp. DKAA, next time give him the disco version, because your logic is too hard :)

Here's the real way!

Code: Select all

/declare i int
/declare mynum int 0
/for i 1 to 100
  /varset mynum ${Math.Calc[${Math.Rand[3]}+1+${mynum}]}
/next
/echo MyNumber (${mynum}) is teh win!
--Jerle

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Sat Oct 23, 2004 1:49 pm

That's probably the type of answer they were expecting, Jerle :)