mIRC Homepage
Posted By: dutch1918 Alias - 10/08/11 05:48 PM
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?
Posted By: Tomao Re: Alias - 10/08/11 06:02 PM
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-
}
Posted By: dutch1918 Re: Alias - 10/08/11 06:17 PM
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
Posted By: RusselB Re: Alias - 10/08/11 10:04 PM
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.
Posted By: dutch1918 Re: Alias - 10/08/11 10:37 PM
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

Posted By: Tomao Re: Alias - 11/08/11 05:27 PM
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.
Posted By: argv0 Re: Alias - 11/08/11 07:25 PM
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.
Posted By: argv0 Re: Alias - 11/08/11 07:27 PM
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.
Posted By: Tomao Re: Alias - 11/08/11 08:17 PM
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
Posted By: dutch1918 Re: Alias - 12/08/11 01:23 PM
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
Posted By: Riamus2 Re: Alias - 12/08/11 01:45 PM
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
Posted By: dutch1918 Re: Alias - 12/08/11 04:29 PM
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
Posted By: argv0 Re: Alias - 12/08/11 08:41 PM
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.
Posted By: Tomao Re: Alias - 12/08/11 10:54 PM
I know one thing: there are lots of Canadians of Dutch decent, especially in Ontario province, in Canada. Pardon me for being off-topic.
© mIRC Discussion Forums