acidrain
Executive Member
- Joined
- Jan 7, 2007
- Messages
- 5,975
Hi guys,
Hoping someone here can help me with this script as i seem to be doing my nut in on this one. Basically what this script is going to do is the following:
When someone types !uptime , the bot will first message the channel with it's own uptime, and then it will message the server's ( wow server for my lan ) uptime by querying column 'uptime' in table 'uptime' in databse 'realmd'.
The problem I'm having is i seem to be getting errors such as "* /if: insufficient parameters (line 4, uptime.mrc) " and if i remove that line it just shows the same thing just on a different line, if state aswell.
I'm sort of okay with c++, but throw in sql scripting and a slightly different format mirc scripting uses, i tend to just lose it.
Code is
As far as the $portfree parameter goes, i don't see a problem with it not recognizing as i have another script running a different command which has the exact same line, just doesn't want to work here.
Just shout if you need anymore info
Hoping someone here can help me with this script as i seem to be doing my nut in on this one. Basically what this script is going to do is the following:
When someone types !uptime , the bot will first message the channel with it's own uptime, and then it will message the server's ( wow server for my lan ) uptime by querying column 'uptime' in table 'uptime' in databse 'realmd'.
The problem I'm having is i seem to be getting errors such as "* /if: insufficient parameters (line 4, uptime.mrc) " and if i remove that line it just shows the same thing just on a different line, if state aswell.
I'm sort of okay with c++, but throw in sql scripting and a slightly different format mirc scripting uses, i tend to just lose it.
Code is
on *:TEXT:!uptime:#:{
msg $chan $me has been online for $uptime(mirc,1) $+ .
var %sql = $mysql_connect(localhost, 3306, 18475, realmd, trinity,trinity)
if ( $portfree(3443) != $true ){
var %test = $mysql_query(%sql, SELECT uptime FROM uptime WHERE `realmid` = 1 ORDER BY `starttime` DESC LIMIT 1 )
var %uptime = $mysql_fetch_row(%test,1)
var $secs = (%uptime % 60)
var $mins = (%uptime / 60 % 60)
var $hours = (%uptime / 3600 % 24)
var $days = (%uptime / 86400)
if ( %days > 0 ){
msg $chan Server uptime: $days days, %hours hours, %minutes minutes and %secs seconds.
}
elseif ( %hours > 0 ) {
msg $chan Server uptime: %hours hours, %minutes minutes and %secs seconds.
}
elseif ( %mins > 0 ){
msg $chan Server uptime: %minutes minutes and %secs seconds.
}
elseif ( %secs > 0 ){
msg $chan Server uptime: %secs seconds.
}
else { msg $chan Server not online }
}
}
As far as the $portfree parameter goes, i don't see a problem with it not recognizing as i have another script running a different command which has the exact same line, just doesn't want to work here.
Just shout if you need anymore info
Last edited: