|
Joined: Oct 2005
Posts: 98
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 98 |
I've got pisg for doing my stats, and all works as it should, I use a .bat file for executing the log generator and also for uploading to my site. My question is: Is it possible to make a script, where if a predifined user types !dostats It will ececute the batfile, and then send a messages to the channel saying: Stats updated, have a look at http://blabla.blaI hope this is possible.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
on *:text:!dostats:#: {
run batchfilename.bat
msg $chan Stats updated, check http://www....com/
}
Of course, you'll probably want to limit this to only voiced or opped users or use the userlist levels to limit it to specific user levels. Also, I'm assuming pisg takes awhile to create the file and get it uploaded, so you might want to put a timer on the msg line to send the msg 30-60 seconds (or whatever it takes to get it created/uploaded) after the /run command.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Oct 2005
Posts: 98
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 98 |
Thanks for the quick reply, the !dostats would it be possible to add a hostmask for that command, so only 1 user could execute it? And regarding the timer, the log isn't that big yet, so the generation of stats and uploads takes betqween 2-5 seconds, however, the timer idea sounds clever. These two things, how would the code look like? Once again, thanks for the quick reply. *EDIT* I tried this:
on *:text:!dostats:#: {
run d:\server\pisg\pisg.bat
.timer 1 10 msg $chan Stats updated, check http://blabla.bla/
}
And it works, I know it might not be the best script, but it works. Now I just need to add a nick or host to the !dostats command so only a specified host or user can use the command, any help on this? I guess I could add an @ in on *:text: But i'd really like to make so only one specific user can use it.
Last edited by starpossen; 18/01/08 01:02 AM.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
The @ wouldn't do anything for you. That only checks to see if the client running the script is an op... not if the person typing the command is an op. Do something like this:
on *:text:!dostats:#: {
if ($address($nick,2) != *!*@host.com) { return }
run d:\server\pisg\pisg.bat
.timer 1 10 msg $chan Stats updated, check http://blabla.bla/
}
Or else put the person's host into your Users list and then use a level on the script:
on 100:text:!dostats:#: {
run d:\server\pisg\pisg.bat
.timer 1 10 msg $chan Stats updated, check http://blabla.bla/
}
That would be level 100+ user could access it. You can also use a named level if you want.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Oct 2005
Posts: 98
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 98 |
Tahnks alot, after being away from home for a few days, I tried what you suggested and it works perfectly Now, how would I add a timer sayin "Check stats at blahblah.blah" And make it repeat everyday at midday? I tried usin the exampl from /help timer : /timer9 14:30 1 1 /say It's now 2:30pm changed it to: /timer9 08:00 1 1 /say Check out the stats at http://blabla.bla/Added it to remote, but nothing happend, any ideas?
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
You have the right idea. You just need to either type it from the edit line and hit enter, or add it to an alias and then run the alias, or put the time into an on START event so it starts automatically whenver you start mIRC.
on *:start: {
.timerStatAd 8:00 1 1 msg #yourchannel Check out the stats at http://...../
}
Replace the channel name with your channel name. Also note that this will not start the timer until mIRC is restarted unless you manually start the timer from the edit line.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Oct 2005
Posts: 98
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 98 |
Works nicely, but I have a weird problem/issue When I execute my .bat file for pisg which works perfectly on my server, everything is fine, but if I use the !dostats command from another computer, I can see the .bat file being executed on my server, but it's not updating the stats, like something is blocking which seems very odd since it's working when I do it manually.
I hope I make sense.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
No idea there unless some program (AV/firewall/etc) is blocking it because of permissions. Or maybe it's just not set up correctly.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Oct 2005
Posts: 98
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 98 |
You have the right idea. You just need to either type it from the edit line and hit enter, or add it to an alias and then run the alias, or put the time into an on START event so it starts automatically whenver you start mIRC.
on *:start: {
.timerStatAd 8:00 1 1 msg #yourchannel Check out the stats at http://...../
}
Replace the channel name with your channel name. Also note that this will not start the timer until mIRC is restarted unless you manually start the timer from the edit line. Im using the on START, but how would I make it so it would announce it without the need to restart it? I mean repeat it everyday at the same time specified in the script? I thought it already did that, but it doesnt.
Last edited by starpossen; 25/01/08 08:36 PM.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Try the -o switch in the timer to make it an offline timer so it's not lost if you disconnect.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Oct 2005
Posts: 98
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 98 |
I never really used timers before this, so bare with me the -o switch, would I place it like so:
on *:start: {
.timerStatAd -o 8:00 1 1 msg #yourchannel Check out the stats at http://...../
}
Or am I just making stupid guesses? I did read in the /help /timer but didnt find what i was looking for.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Yeah. Oh, I just noticed one other thing... you told the timer to only repeat once instead of forever. Change the repetitions from 1 to 0.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Oct 2005
Posts: 98
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 98 |
Is that the first or the second 1 ?
*EDIT* Unless I misread the helpfile, it would be the first.
Last edited by starpossen; 26/01/08 10:17 PM.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Oct 2005
Posts: 98
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 98 |
That change made it spam the message continuesly untill I stopped the timer manually.
|
|
|
|
Joined: Oct 2005
Posts: 98
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 98 |
Any help on why it made a massively spam? I did exactly as told.
|
|
|
|
Joined: Aug 2006
Posts: 19
Pikka bird
|
Pikka bird
Joined: Aug 2006
Posts: 19 |
try this on *:start: {
.timerStatAd -o 8:00 0 1 msg #yourchannel Check out the stats at http://...../
}
ReaperIRC Killgore Computers
|
|
|
|
Joined: Sep 2007
Posts: 65
Babel fish
|
Babel fish
Joined: Sep 2007
Posts: 65 |
Heh. It's not the first. It's the second. Setting the first to 0 means it will do it forever every 1 second.
GamerzWoWThe Official GamerzPlanet WoW Server
|
|
|
|
|