mIRC Home    About    Download    Register    News    Help

Print Thread
#49801 16/09/03 11:00 PM
Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
Ok, first up i made a random number generator script for a game i`m making
This is the first part before i code anymore, and it`s not working, it works for me and no one else. frown

The Code
Code:
on *:text:!rand:#Trivia {
  msg $chan $nick Your number is4 $rand(0,100) 
}


I added this to my remotes section on my bot who uses V6.03
(for compatabilty until KTools.dll is updated)

I myself ShadowDemon uses V6.1 of mIRC and everytime i type
!rand

My bot gives the message above followed by my random number

[23:54] <@ShadowDemon> !rand
[23:54] <@MyBot> ShadowDemon Your number is 61
[23:55] <Test> !rand
[23:57] <@ShadowDemon> !rand
[23:57] <@MyBot> ShadowDemon Your number is 74
[23:57] <@Test> !rand

Ok the problem i`m having is that when i ask my friends to type the same line
!rand, they get nothing, i have asked different people with differing versions of mIRC
from V6.0 right upto V6.1 with V6.01 and V6.03 in the middle and they all get nothing.
The problem lines in the above example are shown in Blue

Could somebody please look at this code for me and tell me whats wrong with it, as i
cant see anything wrong ?

I checked for any other on text scripts running and even disabled then incase they
were interfering at all.
(I built my bot up and it does have on text scripts but i unloaded them)

No flood controls are enabled as i was using my test server (Private)

Thanks ShadowDemon
mIRC V6.1


Never argue with an idiot...they'll drag you down to their level and beat you up with experience
#49802 16/09/03 11:34 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Not that it would make a difference, but you are missing a colon after your channel name (:). Also, make sure their name or mask doesnt match one perhaps on the ignore list. The bot might be ignoring the user, and not listening to text said by that person.


-KingTomato
#49803 16/09/03 11:53 PM
Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
Thanks for pointing out the : for me KT blush

Umm no one is on my ignore list and i just retested that code with the Colon in, nope it still not giving a random number
to my friend frown

ShadowDemon


Never argue with an idiot...they'll drag you down to their level and beat you up with experience
#49804 17/09/03 12:37 AM
Joined: Jan 2003
Posts: 150
J
Vogon poet
Offline
Vogon poet
J
Joined: Jan 2003
Posts: 150
and what about on 1:TEXT: .......


Go ahead, jump. 100,000 lemmings can't be wrong.
#49805 17/09/03 03:48 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
* would cover level 1, as well as named levels. Thats what i first thought--maybe they are at a named level, and the command looks for numerics.. but nope..


-KingTomato
#49806 17/09/03 04:08 PM
Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
Hmm, retested this code again today, no luck at all

Thanks to all who looked at the code and KT for pointing out the missing colon : even tho it made no difference

Yeah i do realise the * would cover all levels thats why i put it in, so anybody could type !rand

ShadowDemon


Never argue with an idiot...they'll drag you down to their level and beat you up with experience
#49807 17/09/03 06:43 PM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Are your friends using ctrl codes or something? If so, ask them to type "/!say !rand", see if it works then.
Anyway, it would be better if you used..
Code:
on *:text:*:#Trivia:{
  if ($strip($1) == !rand) { msg $chan $nick Your number is4 $rand(0,100)  }
}
..or maybe the new regex feature, if you're using mIRC 6.1:
Code:
on $*:text:/^!rand$/S:#Trivia:{ msg $chan $nick Your number is4 $rand(0,100)  }


* cold edits his posts 24/7
#49808 17/09/03 07:50 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
In addition to cold's post, if you are using mIRC 6.1 you might try using
Code:
on $*:text:/^\s*!rand\s*$/S:#Trivia:msg $chan $nick Your number is4 $rand(0,100) 

This way control codes and leading/trailing spaces are ignored.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#49809 17/09/03 09:48 PM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
This way control codes and leading/trailing spaces are ignored.

Oops, yeah, I forgot these. smile Sorry, shadowdemon.


* cold edits his posts 24/7
#49810 17/09/03 10:35 PM
Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
Thanks for that suggestion Cold & StarBucks

I tried !say !rand and my friends still dont get the random number

The bot MUST be running V6.03 of mIRC or the script i made with the docked dialog (using MDX and KTools.dll) doesnt work with V6.1 (waiting for a fix).

So i tried your first code and changed my original code and still doesnt work, tried quitting mirc and leaving my friend in with the bot still nothing, i have looked in the options of my mirc`s and remotely Via XP of my firends options, still cant find what the problem is, this is way to weird.

Thanks tho, might have to go rethink my random number game i was planning on making.

ShadowDemon


Never argue with an idiot...they'll drag you down to their level and beat you up with experience
Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
*** An Update ***

Just to let you all know i finally got the script working confused confused confused
Having checked all options across the various mIRC versions, i checked my bot, somehow
and i dont know why it just started working, my friend who was having the problem the most
can now get his random number.

Unsure to why or how it just started working, so i guess i'll be trying to finish off teh script.

Thanks to all who tried to help, good job grin

ShadowDemon
(ok too much smiles)


Never argue with an idiot...they'll drag you down to their level and beat you up with experience

Link Copied to Clipboard