mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Joined: Jun 2004
Posts: 45
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2004
Posts: 45
I am wanting to make it so if you type something like "!list" or !hit in your channel it will message a (whatever i put into the list) into the room or better yet message it to the person who typed the "!list" command does anyone know how i can do this, im a n00b so all help we be greatly appreciated, thanks.

Last edited by born2ball; 17/06/04 06:45 PM.
Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
Code:
on *:text:*:#mychsnnel: {
  if (!list isin $1) .play $chan !list.txt 2000 
  ; (plays a text file to the channel)
  if (!hit isin $1) .play -m $nick !hit.txt 2000 
  ; (plays a text file to the user)
}


put the above in a new remote file (alt + R .. file .. new)

put your text you want played in a (.txt) file in the main mirc folder, and change the above to call that filename


I refuse to engage in a battle of wits with an unarmed person. wink
Joined: Jun 2004
Posts: 45
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2004
Posts: 45
copy and paste exactly what you typed into a text file then place it under programfiles>mIRC ? am i right ? lol sorry once again im a n00b thx a ton

Joined: Jun 2004
Posts: 45
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2004
Posts: 45
Could you explain what you just said in a little bit more detail i think i got it for the most part im just lost on what 2 paste exactly when i hit alt+r

Joined: Jun 2004
Posts: 45
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2004
Posts: 45
The channel im in and want it to go to is #C.H.I on accessIRC if thatd help you fill in the code better also if it could message the user with the info when they type the !list command thatd be great thx a ton

Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
Hey there,

There is no need to post 3 different posts in such a short time, these boards are not IRC and it could take a couple of hours or longer for you to receive an answer. Furthermore, you have 2 hours to edit your post before the ability to do that is blocked, simply click on the 'Edit' button and add what you forgot to it.

You can just use the code that CtrlAltDel provided to you, but change the channel name in the first line to the channel you want it to activate on:

Code:
on *:text:*:[color:red]#C.H.I[/color]: {
  if (!list isin $1) .play $chan !list.txt 2000 
  ; (plays a text file to the channel)
  if (!hit isin $1) .play $nick !hit.txt 2000 
  ; (plays a text file to the user)
}


This will /play the file !list.txt to the channel if someone types !list, or if they type !hit it will /play the file !hit.txt. You need to create these files and put the information inside them for this to work, or replace those files in the code with the files you want to play. For further help, type /help playing files in mIRC where each part of the /play command is explained. I don't think the -m switch was used correctly so I removed it from the above.

The code is not meant to be taken literally. You need to change !hit.txt and !list.txt to whatever file you want to read and play information from. You can use play $nick to send it to the nickname that wrote the comand.

Regards,


Mentality/Chris
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Oeps! Mentality was faster wink

Last edited by Zyzzyx26; 17/06/04 08:14 PM.

"All we are saying is give peace a chance" -- John Lennon
Joined: Jun 2004
Posts: 45
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2004
Posts: 45
sorry about the posts and thx AGAIN ment. damn your fast

when i use alt + r I see 5 tabs each of them display there own text, the tabs say Aliases, Popups, Remote, Users, and Variables which list do i want to paste this code in ?

on *:text:*:#C.H.I: { if (!list isin $1) .play $chan !list.txt 2000 ; (plays a text file to the channel) if (!hit isin $1) .play $nick !hit.txt 2000 ; (plays a text file to the user)}


thx

Last edited by born2ball; 17/06/04 08:34 PM.
Joined: Jun 2004
Posts: 45
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2004
Posts: 45
update:


I tryed and did as you were saying, I copy and pasted

on *:text:*:#C.H.I: { if (!list isin $1) .play $chan !list.txt 2000 ; (plays a text file to the channel) if (!hit isin $1) .play $nick !hit.txt 2000 ; (plays a text file to the user)}

after i hit alt + r > file > new

then made a !list text file went to start > mycomputer > C: > programfiles > mIRC and droped that text file in there and last typed !list in the room nothin happend confused

Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
Firstly, due to the way Internet Explorer copies things on this board you'll need to first paste the code into a program such as Notepad - Type //run notepad and then paste it there. After that, copy and paste it into your remotes so it's on multiple lines.

The next thing is, you cannot trigger ON TEXT events by yourself, they only trigger when someone else types !list. To detect your own words you need to use the ON INPUT event, see /help on input.

Regards,


Mentality/Chris
Joined: Jun 2004
Posts: 45
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2004
Posts: 45
still nothing if your can message me on mIRC and help me anyone id GREATLY appreciate it my handle is born2ball



* /play: unable to open 'C:\Documents and Settings\anyone\My Documents\Programs\AjpRO\!list.txt'
-
* /play: unable to open 'C:\Documents and Settings\anyone\My Documents\Programs\AjpRO\!list.txt'
-
* /play: unable to open 'C:\Documents and Settings\anyone\My Documents\Programs\AjpRO\!list.txt'
-
* /play: unable to open 'C:\Documents and Settings\anyone\My Documents\Programs\AjpRO\!list.txt'
-
* /play: unable to open 'C:\Documents and Settings\anyone\My Documents\Programs\AjpRO\!list.txt'
-
* /play: unable to open 'C:\Documents and Settings\anyone\My Documents\Programs\AjpRO\!list.txt'
-
* /play: unable to open 'C:\Documents and Settings\anyone\My Documents\Programs\AjpRO\!list.txt'
-
.•. invalid command: (PLAYS
.•. invalid command: (PLAYS
.•. invalid command: (PLAYS
.•. invalid command: (PLAYS





Last edited by born2ball; 17/06/04 09:33 PM.
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
Few tips:

1) Make sure the code is on multiple lines and not on ONE line.
2) Make sure the code is in a NEW remote file, File > New
3) Make sure you have another client typing !list and/or !hit in the correct channel. It will only trigger in the channel you have specified.
4) Make sure !list.txt and/or !hit.txt is in your mIRC directory.
5) If you're using the code above !list will be played to the channel and !hit will be played to the nickname.
6) There is a . preceding the play command in the code above therefore, you will not see yourself *send* the text, but you should receive it. If you wish to see it, remove the '.' in .play[/color].

Edit: The invalid command error is coming from the fact you're trying to execute a command (play which doesn't exist. You probably have a missing space somewhere so you haven't put the code in the remote file correctly. Also remember the command is /play not /plays. Make sure the .txt file is in the directory that is showing up in the other error messages and that it actually has information inside of it.

Regards,

Last edited by Mentality; 17/06/04 09:37 PM.

Mentality/Chris
Joined: Jun 2004
Posts: 45
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2004
Posts: 45
on *:text:*:#C.H.I: { if (!list isin $1) .play $chan !list.txt 2000 ; (plays a text file to the channel) if (!hit isin $1) .play $nick !hit.txt 2000 ; (plays a text file to the user)}


That is the exact code i am putting in the remote tab after file>new

in mIRC directory, which correct me if im wrong, is accessed by Start > My Computer > C: > Program Files > mIRC <~~this is where i put what i want said under a txt file from notepad named !list.txt

Maybe you can see what im doing wrong from there, above is exactly how ive been tryin to get it to work, Thx. confused

Last edited by born2ball; 17/06/04 09:50 PM.
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
Indeed, given that there is a commented line saying ; (plays.. I am guessing you're putting the code all on one line. For the third time, you cannot do this smile

You need to paste the code on multiple lines EXACTLY as shown below:

Code:
on *:text:*:#C.H.I: {
  if (!list isin $1) .play $chan !list.txt 2000
  ; (plays a text file to the channel) 
  if (!hit isin $1) .play $nick !hit.txt 2000 
  ; (plays a text file to the user)
}


Or, if it makes matters easier, you can exclude the commented lines (commented lines are lines that start with ; by the way) from the code:

Code:
on *:text:*:#C.H.I: {
  if (!list isin $1) .play $chan !list.txt 2000
  if (!hit isin $1) .play $nick !hit.txt 2000 
}


Once again though, it must be in your remote file exactly as above, not on one line.

Regards,


Mentality/Chris
Joined: Jun 2004
Posts: 45
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2004
Posts: 45
* /play: unable to open 'C:\Documents and Settings\anyone\My Documents\Programs\AjpRO\!list.txt' (line 2, script2.mrc)



and the frustration builds . . confused

im using the anaconda script could that be interfering with this process?

Last edited by born2ball; 17/06/04 10:09 PM.
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
One way to work is copying the .txt files to the mIRC directory.. so you can remove all the path from the file and just use !list.txt

* I didn't read the whole thread, so if you stated you cannot do that, sorry then smirk

Zyzzyx smile


"All we are saying is give peace a chance" -- John Lennon
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
I guess you have placed the mIRC.exe for the script in the directory: C:\Documents and Settings\anyone\My Documents\Programs\AjpRO\ as that is what /play is trying to access. You have placed the !list.txt file in the original mIRC directory.

Try moving the .txt file to the directory specified in the error message.

Regards,


Mentality/Chris
Joined: Jun 2004
Posts: 45
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2004
Posts: 45
I got it runnin LOL thx a ton ive learned so much in just my 1st day of scripting thx again


now 1 last thing instead of posting it in the channel open whats the code i need to have it messaged 2 them?

Also everyone else is gettin the !list but me =\

Last edited by born2ball; 17/06/04 10:40 PM.
Joined: Jun 2004
Posts: 45
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2004
Posts: 45
thought of 1 more question to, if I ever want 2 change the !list command to say !friendly how would i do that

Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
Simply change the appropriate line:

if (!list isin $1) .play $chan !list.txt 2000

Can become:

if (!friendly isin $1) .play $chan !friendly.txt 2000

Do note, the name of the .txt file doesn't have to match the !trigger, that's just the way in the example. You could have if (!whatever isin $1) .play $chan !mippybop.txt 2000 aswell.

Regards,


Mentality/Chris
Joined: Jun 2004
Posts: 45
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2004
Posts: 45
What about me being able 2 see it as well, everyone else can but me lol kinda sucks all that work and i cant see it myself unless someone else uses the tringer grin

Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
Well, you could just use the /play command on it's own... for example, /play your-nickname file.txt 2000, you can type that in the editbox itself without a script.

If you want to do it for when you type, for example, !list to the channel however, then use the ON INPUT event as I described earlier, for example:

Code:
on *:input:#channel:{
if (!list isin $1) play $me !list.txt 2000
}


Then when you type !list yourself, you'll play the specified file to yourself. Do remember to change #channel to the channel name you want it to work on.

Regards,


Mentality/Chris
Joined: Jun 2004
Posts: 45
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2004
Posts: 45
I left the room and came back now it dont work . .

Last edited by born2ball; 18/06/04 01:24 AM.
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
It's no problem smile

I don't quite understand that question though - if you mean how can you get the list too, then the command above should send you it to yourself in Private Message ($me means your nickname).

If you're having issues, could you elaborate? :-)

Regards,


Mentality/Chris
Joined: Jun 2004
Posts: 45
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2004
Posts: 45
i left the room and came back now no one is gettin the !list command

Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
Cycling the channel should not affect how the script works at all. If you're inside the channel, if someone else types !list then it should still work provided you haven't changed anything. Make sure you have not put the ON TEXT and ON INPUT code together in the same file.

Regards,


Mentality/Chris
Joined: Jun 2004
Posts: 45
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2004
Posts: 45
Okay, just curious, is there anyway i can make what pops up when typed !list green and when typed !hit red?

Joined: Aug 2003
Posts: 309
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Aug 2003
Posts: 309
Quote:
There is no need to post 3 different posts in such a short time, these boards are not IRC and it could take a couple of hours or longer for you to receive an answer


i am going to assume you ment 3 posts on the same thread.

i have to disagree with that logic unless its 3 different threads. this is my reason.

when i come in and read a thread. it gets all discombobulated because of all the editing. i dont know what was asked before hand or what order or what answer goes to what. doesnt help me or others if i or we decide to come in and lend a helping hand.

just my thoughts.


-Nick (Darko)
-Admin irc.aussiechat.org
-#Chatzone, #helpdesk
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Whenever a new reply comes into a thread i've posted in, as long it's a reasonable size (not too big), i check for edits anyway, so i agree with mentality that three posts aren't needed.


New username: hixxy
Joined: Jun 2004
Posts: 45
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2004
Posts: 45
lol uh can anyone answer my last ?

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
It should work, but if it doesn't - add this as the first line of your text and input event body (right above the IF's):
  • tokenize 32 $strip($1-)

Joined: Jun 2004
Posts: 45
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2004
Posts: 45
it works just wonderin if i can color code each list like !list would show up green and !hit would show up red

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Yes, you can put color codes in your text file. Do a Ctrl+K in mIRC editbox, select a color number, then copy the result and paste it in Notepad before each line you want colored.

Page 1 of 2 1 2

Link Copied to Clipboard