mIRC Home    About    Download    Register    News    Help

Print Thread
#233389 10/08/11 05:48 PM
Joined: Nov 2005
Posts: 26
D
Ameglian cow
OP Offline
Ameglian cow
D
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?

dutch1918 #233390 10/08/11 06:02 PM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Give this a try:
Code:
econcalmsg { 
  scon -at1 msg $readini(file.ini,advert,$network) $$1-
}
tradesmsg {
  scon -at1 msg $readini(file.ini,trades,$network) $$1-
}

Tomao #233391 10/08/11 06:17 PM
Joined: Nov 2005
Posts: 26
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2005
Posts: 26
Originally Posted By: Tomao
Give this a try:
Code:
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

dutch1918 #233393 10/08/11 10:04 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
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.

RusselB #233395 10/08/11 10:37 PM
Joined: Nov 2005
Posts: 26
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2005
Posts: 26
Originally Posted By: RusselB
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

Code:

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:

Code:
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


dutch1918 #233411 11/08/11 05:27 PM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
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.

Tomao #233412 11/08/11 07:25 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
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"
dutch1918 #233413 11/08/11 07:27 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
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"
argv0 #233414 11/08/11 08:17 PM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Originally Posted By: argv0
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

argv0 #233415 12/08/11 01:23 PM
Joined: Nov 2005
Posts: 26
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2005
Posts: 26
Originally Posted By: argv0
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.

Quote:
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. smile

Last edited by dutch1918; 12/08/11 01:27 PM.
dutch1918 #233416 12/08/11 01:45 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
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. smile


Invision Support
#Invision on irc.irchighway.net
Riamus2 #233420 12/08/11 04:29 PM
Joined: Nov 2005
Posts: 26
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2005
Posts: 26
Originally Posted By: Riamus2
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. smile


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.
dutch1918 #233423 12/08/11 08:41 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Originally Posted By: dutch1918

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"
dutch1918 #233426 12/08/11 10:54 PM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
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.


Link Copied to Clipboard