mIRC Home    About    Download    Register    News    Help

Print Thread
Help with /me in text files #129973 11/09/05 09:39 PM
Joined: Sep 2005
Posts: 5
S
SonnyZA Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Sep 2005
Posts: 5
Ello there,

I'm new to mirc, only started a few days ago, and i'm building/modifying a bot. If I want the script to read random lines from a text file, but i would like to put actions in there.

I saw this, I can in the remote files with......

Code:
on 1:text:*lol*:#: {  
  set %tk $rand(146)
  if (%tk == 1) { describe $chan looks at people laughing } 
  if (%tk == 2) { describe $chan laughs with everyone }
  if (%tk == 3) { describe $chan Laugh out Loud }
  if (%tk == 4) { describe $chan can't see what's so funny! }


but i wanted much more option, so i did this........

Code:
on 1:text:*lol*:#:/msg $chan $read(c:\mirc\txt\lol.txt) }


but how can i do actions in a text file? /me doesnt work, neither "describe"

I have even tried this......

Code:
on 1:text:*lol*:#: {  
  set %tk $rand(1,3)
  if (%tk == 1) { msg $chan $read(c:\mirc\txt\lol.txt) }
  if (%tk == 2) { describe $chan looks at people laughing }
  if (%tk == 3) { describe $chan Laugh out Loud }


but I get errors, like:

* /msg: insufficient parameters (line 341, talk.txt)


Any help or advice please ? smile

Greetings smile

Re: Help with /me in text files #129974 11/09/05 09:58 PM
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Im sorta confused why your using $rand and putting it has a identifier but shortest way of describing whatever to chan is..

on *:TEXT:*:*: {
if (lol isin $1-) { describe $chan $read(.\txt\lol.txt) }
; the script is self explanatory if lol is in any words when someone says it then it describes which is /me to $chan a line from txt\lol.txt
}

$read command usually already randomly picks it.. but if you want something otherwise just tell me a bit more explanation


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Re: Help with /me in text files #129975 11/09/05 11:11 PM
Joined: Sep 2005
Posts: 5
S
SonnyZA Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Sep 2005
Posts: 5
hello,

And thank you for replying.

Ok, I've put that in, and I do still get the same error.

* /describe: insufficient parameters (line 340, talk.txt)

As I said I'm very new to mirc, started only few days back, so I'm learning by excample and reading the help files. smile

Re: Help with /me in text files #129976 11/09/05 11:21 PM
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
erm...
try this

on ^1:TEXT:*:*: {
if (lol isin $1-) { describe # hey $read( $+ .\txt\lol.txt $+ ) }
}


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Re: Help with /me in text files #129977 11/09/05 11:22 PM
Joined: Sep 2005
Posts: 5
S
SonnyZA Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Sep 2005
Posts: 5
Ok, wait, found a problem, I had sppell mistake, but it does however do this........

Nick /describe <text here>

So it doesn t do the action...properly.....

Re: Help with /me in text files #129978 12/09/05 12:58 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
So it doesn t do the action...properly.....


No you arent doing the action correctly, but since your not listing the code i dont know what you expect anyone to do about it.

Re: Help with /me in text files #129979 12/09/05 02:58 AM
Joined: Jul 2003
Posts: 655
Om3n Offline
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
The . symbol does not represent the program directory in mirc as it doesn in various other languages and unix systems. Use $read($mircdirtxt\lol.txt) Note there is not \ between $mircdir and txt\lol.txt because $mircdir returns the path with a \ suffix already.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
Re: Help with /me in text files #129980 12/09/05 03:37 AM
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Actually Om3n . does represent the main mirc dir
.\download\ would execute downloads folder try it smile

/run .\download\


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Re: Help with /me in text files #129981 12/09/05 08:35 AM
Joined: Jul 2003
Posts: 655
Om3n Offline
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
Indeed you are correct, and it evaluates fine in an identifier without the use of $+'s. The are just two reasons i can think of why that error with describe would occur. First is if they are trying to read from a file that does not exis, and second would be if the path contains a comma.

To solve an issue with comma's in path's, simply assign the path to a local variable and then use the variable in the $read. Try it like this SonnyZA.

Code:
on *:TEXT:*:*: {
  if (lol isin $1-) {
    var %dfile .\txt\lol.txt
    describe $target $read(%dfile)
  }
}


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
Re: Help with /me in text files #129982 12/09/05 08:53 AM
Joined: Apr 2003
Posts: 701
K
Kelder Offline
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
on *:TEXT:*lol*:#: $read(lol.txt)

and lol.txt is in the mIRC main folder and contains something like this:

describe $chan lol right back at ya
msg $chan haha
notice $nick just to tell you I'm laughing too
msg $nick here's a private lol for you!

This will run one random line of that file everytime someone says lol in the channel. If you want it to work for queries too, change $chan to $target. You see that the entire command line is included.

Another way:
on *:TEXT:*lol*:#: describe $chan $read(lol.txt)
Then lol.txt should look like this, and all random lines are sent as text in a action. You see the describe (or msg) is in the script, while only the text of the message is in the file. This makes for a nicer file, but you cannot have messages and actions combined, it's either one or the other...

slaps $nick around with a large rotfl
laughs too!
doesn't like that joke.


For both of those files, make sure there are no empty lines as those will give a * describe insufficient parameters error sometimes.

Re: Help with /me in text files #129983 12/09/05 11:03 AM
Joined: Sep 2005
Posts: 5
S
SonnyZA Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Sep 2005
Posts: 5
Quote:
No you arent doing the action correctly, but since your not listing the code i dont know what you expect anyone to do about it.


Sorry I was unclear, was talking about the code that Lpfix5 gave me smile I think I did something wrong there smile

Quote:
The . symbol does not represent the program directory in mirc


No , didnt use that . But i put $read(c:\mirc\txt\lol.txt)

Quote:
on *:TEXT:*lol*:#: $read(lol.txt)

and lol.txt is in the mIRC main folder and contains something like this:

describe $chan lol right back at ya
msg $chan haha
notice $nick just to tell you I'm laughing too
msg $nick here's a private lol for you!



Bingo! Excactly what i needed! Tnx a million to all your guys. If i'm unclear sometimes, bear with me, English is not my home lingo. smile Plus, I know mirc scripting for a few days now, no expert like all of you :P

I find you guys amazing, I think i'm going to like learning mirc scripting!


Thank you!!!!