mIRC Home    About    Download    Register    News    Help

Print Thread
Random amount of time script... #129233 03/09/05 01:56 PM
Joined: Sep 2005
Posts: 2
S
sudn3sc3d Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
S
Joined: Sep 2005
Posts: 2
Hey,

I have been working on this mIRC bot since the past few days. I wanted to add a script to it but I got stuck at one part. I was wondering if you guys could help me out.

I need something that makes the bot visit a website with a delay of random minutes between the time the command is sent to the channel and the time the next day starts. For example-

[6:01PM] <sudn3sc3d> !visit www.mysite.com -random
[6:01PM] <bot|00001> Calculating total number of minutes left in the day. Local time: 6:01PM. Minutes left= 359
[6:02PM] <bot|00001> Choosing random number of minutes between 1 and 359..... Visiting www.mysite.com after 158 minutes...

I already have the part the time calculating part

$round($calc(($ctime($date 11:59pm) - $ctime($date $time)) / 60),0)
(thx to RoCk at irc.rizon.org #mirc)

Please help me out and tell me what should I do next to link all this together

Last edited by sudn3sc3d; 03/09/05 02:16 PM.
Re: Random amount of time script... #129234 03/09/05 03:53 PM
Joined: Aug 2005
Posts: 39
B
buster2007 Offline
Ameglian cow
Offline
Ameglian cow
B
Joined: Aug 2005
Posts: 39
try
$rand(1,$round($calc(($ctime($date 11:59pm) - $ctime($date $time)) / 60),0) )
it generates a random number between 1 and $round.....

Re: Random amount of time script... #129235 03/09/05 04:27 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Please note that most commands in mIRC that use a timing need the timing to be measured in seconds

Re: Random amount of time script... #129236 03/09/05 08:43 PM
Joined: Apr 2003
Posts: 701
K
Kelder Offline
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Define 'making a bot visit a website'

Do you want to just open the site in your browser -> /run www.yoursite.com
Do you want to download the contents of a page and display that to a channel or local mIRC window? -> do a search, there are enough examples on this site and other mIRC scripting sites about using sockets to download a web page.
Do you want your bot to laugh at the daily comic? -> .timer 1 $calc(%randomminutes * 60) describe $chan surfs to %site and likes it!
Do you want something else? -> then say so...