|
Joined: Nov 2005
Posts: 26
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2005
Posts: 26 |
I have the following alias
econcalmsg { var %i = $scon(0) while (%i > 0) { scon %i if ($readini(file.ini,advert,$network) !== $null) { msg $v1 $1- } dec %i } }
tradesmsg { var %i = $scon(0) while (%i > 0) { scon %i if ($readini(file.ini,trades,$network) !== $null) { msg $v1 $1- } dec %i } }
and here is my file.ini
[advert] network1=#channel network2=#channel
[trades] network1=#channel network2=#channel,#channel
I can get the econcalmsg to work ok but not the tradesmsg one. What am I doing wrong?
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,129 |
Give this a try: econcalmsg {
scon -at1 msg $readini(file.ini,advert,$network) $$1-
}
tradesmsg {
scon -at1 msg $readini(file.ini,trades,$network) $$1-
}
|
|
|
|
Joined: Nov 2005
Posts: 26
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2005
Posts: 26 |
Give this a try: econcalmsg {
scon -at1 msg $readini(file.ini,advert,$network) $$1-
}
tradesmsg {
scon -at1 msg $readini(file.ini,trades,$network) $$1-
} no luck with that one either
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Try changing $network to $!network
The difference between the two is that $network gets evaluated on the first call of scon, thus it is set to the network name that the code is called from. Using $!network makes mIRC evaluate $network for each network encountered.
|
|
|
|
Joined: Nov 2005
Posts: 26
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2005
Posts: 26 |
Try changing $network to $!network
The difference between the two is that $network gets evaluated on the first call of scon, thus it is set to the network name that the code is called from. Using $!network makes mIRC evaluate $network for each network encountered. sigh!!! that does not work either. I don't understand why the following code works
postmsg {
var %i = $scon(0)
while (%i > 0) {
scon %i
if ($readini(file.ini,advert,$network) !== $null) { msg $v1 $1- }
dec %i
}
}
file.ini
[advert]
network1=channel
network2=channel
and this code does not:
postmsg {
var %i = $scon(0)
while (%i > 0) {
scon %i
if ($readini(post.ini,advert,$network) !== $null) { msg $v1 $1- }
dec %i
}
}
post.ini
[advert]
network1=channel
network2=channel1,channel2
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,129 |
You do notice you have two identical aliases sharing the same command? "/postmsg"
The only alias works to respond is the one being put on top.
Change the other one to a different alias command.
|
|
|
|
Joined: Oct 2003
Posts: 3,918
Hoopy frood
|
Hoopy frood
Joined: Oct 2003
Posts: 3,918 |
Tomao, you're not spending enough time reading his posts...
Those aliases are the same code. The difference in his two examples is the data.
- argv[0] on EFnet #mIRC - "Life is a pointer to an integer without a cast"
|
|
|
|
Joined: Oct 2003
Posts: 3,918
Hoopy frood
|
Hoopy frood
Joined: Oct 2003
Posts: 3,918 |
My guess is the network you're using doesn't support multiple channel targets for PRIVMSG. Basically, you're attempting to issue the command /msg #chan1,#chan2 foo, which is not always supported. If your complaint is in fact that it isn't working for you, it's most likely because it's unsupported on your network.
If you type the above command out manually, you should see it fail. Checking your status window will also show you WHY it is failing (which you should have been checking for debugging info about your script from the start). Again, if my guess is correct, you'll be seeing "too many targets" (though some naughty networks may just hide that message).
As far as how you can fix it-- I'm not really all that interested in helping somebody complete what appears to be a spam/advertising script. Perhaps somebody else will tell you how to fix this. Note that /msg #chan1,#chan2 is disabled on these networks specifically to curb spam. It would be wrong to help you bypass basic IRC etiquette.
- argv[0] on EFnet #mIRC - "Life is a pointer to an integer without a cast"
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,129 |
Tomao, you're not spending enough time reading his posts...
Those aliases are the same code. The difference in his two examples is the data. My bad, argv0. I could only pop up to vist the forum every now and then at work. lol
|
|
|
|
Joined: Nov 2005
Posts: 26
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2005
Posts: 26 |
My guess is the network you're using doesn't support multiple channel targets for PRIVMSG. Basically, you're attempting to issue the command /msg #chan1,#chan2 foo, which is not always supported. If your complaint is in fact that it isn't working for you, it's most likely because it's unsupported on your network.
If you type the above command out manually, you should see it fail. Checking your status window will also show you WHY it is failing (which you should have been checking for debugging info about your script from the start). Again, if my guess is correct, you'll be seeing "too many targets" (though some naughty networks may just hide that message). I understand that however, in my second data file (post.ini) if you change all the content to the same and the only thing that has changed is the name of the data file, no output (zero) is given. As far as how you can fix it-- I'm not really all that interested in helping somebody complete what appears to be a spam/advertising script. Perhaps somebody else will tell you how to fix this. Note that /msg #chan1,#chan2 is disabled on these networks specifically to curb spam. It would be wrong to help you bypass basic IRC etiquette. You must have pre-conceive ideas and I would not expect much less from people from Montreal, QC, Canada.
Last edited by dutch1918; 12/08/11 01:27 PM.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Ok, so if you have just the first alias and it's working and you then edit that alias to point to a different filename, that's when it stops working? Try typing these and post the output here (make sure you're on the network you are testing this on): //echo -a $exists(post.ini) //echo -a $ini(post.ini,advert) //echo -a $ini(post.ini,advert,$network) As far as the comment on this being spam related, this lets you send a message to many channels at once and uses the word "advert". It does look like a script for posting unsolicited text to multiple channels (i.e. advertising/spamming). It can be used for other things, but the choice of wording in it makes it appear to be for spamming and not just a server message or something like that. You really shouldn't be surprised if someone thinks this is for spamming when you haven't said what it's for. 
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Nov 2005
Posts: 26
Ameglian cow
|
OP
Ameglian cow
Joined: Nov 2005
Posts: 26 |
Ok, so if you have just the first alias and it's working and you then edit that alias to point to a different filename, that's when it stops working? Try typing these and post the output here (make sure you're on the network you are testing this on): //echo -a $exists(post.ini) //echo -a $ini(post.ini,advert) //echo -a $ini(post.ini,advert,$network) As far as the comment on this being spam related, this lets you send a message to many channels at once and uses the word "advert". It does look like a script for posting unsolicited text to multiple channels (i.e. advertising/spamming). It can be used for other things, but the choice of wording in it makes it appear to be for spamming and not just a server message or something like that. You really shouldn't be surprised if someone thinks this is for spamming when you haven't said what it's for. It's for news alerts for different stock channels //echo -a $exists(post.ini) = $true //echo -a $ini(post.ini,advert) = insufficient parameters //echo -a $ini(post.ini,advert,$network) = insufficient parameters after getting the above I just copied file.ini to post.ini and now get 1 on those. It is now working. I guess I made some type of error when I created the 1st file. Anyway thanks for your help
Last edited by dutch1918; 12/08/11 04:39 PM.
|
|
|
|
Joined: Oct 2003
Posts: 3,918
Hoopy frood
|
Hoopy frood
Joined: Oct 2003
Posts: 3,918 |
You must have pre-conceive ideas and I would not expect much less from people from Montreal, QC, Canada.
Ahh the irony.
- argv[0] on EFnet #mIRC - "Life is a pointer to an integer without a cast"
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,129 |
I know one thing: there are lots of Canadians of Dutch decent, especially in Ontario province, in Canada. Pardon me for being off-topic.
|
|
|
|
|