Chatspace/ircd checker

By blackvenomm666 on Jan 07, 2012

Now i know this can be done a million ways. Using .txt files or ini's or hash tables but i chose to use .txt files. Basically i made this because i use both chatspace servers and ircd and it was pissing me off that i couldn't get a reliable way to check for each because some commands on chatspace do different things than on ircd simple command would be .mode # +q. On chatspace it gives the person quiet status so they can't talk in a channel but on ircd it gives them owner. so i came up with this little snippet All you need to do is make yourself your snippet that needs to check between the two diff types of servers and use the cs checker alias in it i will post an example of such being used.

on *:connect:{ 
  .enable #chatspacecheck
  .version
}
#chatspacecheck on
raw 351 :*: { 
  if (CS isin $1- ) && ($server != $read(cscheck.txt,w,$server)) {
    write cscheck.txt $server
    .disable #chatspacecheck
  }
  elseif (CS !isin $1- ) {
    .disable #chatspacecheck
  }
}
#chatspacecheck end
alias cschecker { 
  if ($server == $read(cscheck.txt,w,$server))  {
    return $true
  }
  else { return $false
  }
}

Comments

Sign in to comment.
Lucius   -  Jul 09, 2012

With an alias and storage though, you can more easily edit any other scripts to check rather than manually check in each one.
Nice work Ryan.

 Respond  
blackvenomm666   -  Jan 08, 2012

O_O

 Respond  
SReject   -  Jan 08, 2012

bump

 Respond  
blackvenomm666   -  Jan 08, 2012

when i left that second check it always returned yes

 Respond  
SReject   -  Jan 08, 2012

be weary. b/c 'q' in channel modes can be both for 'quiet' or for 'admin'
Hence the 2nd check to make sure q is a mode that will effect a nick's power in the channel.

I updated it, atleast the name, and removed a check to make it more clear. Basically I check if q changes the nick's control level, and if so return $true. so:

if ($qIsAdminMode) {
  ;this will make $1 a channel admin:
  mode # +q $1
}
else {
  ;this will 'quiet' $1
  mode # +q $address($1,2)
}
 Respond  
blackvenomm666   -  Jan 08, 2012

ah messed with it a bit

alias cschecker2 {
  if (q isin $chanmodes) {
    echo -a no
  } 
  else {
    echo -a yes
  }

}

that one works

 Respond  
blackvenomm666   -  Jan 08, 2012

i tested it and that doesnt work:/

 Respond  
blackvenomm666   -  Jan 08, 2012

.< darn you sreject haha i didnt even think of that

 Respond  
SReject   -  Jan 08, 2012

...or no files/variables needed. Just check modes:

alias qIsAdminMode {
  if (q isincs $nickmode) return $true
  return $false
}
 Respond  
xdesoto   -  Jan 07, 2012

Very nice, and useful.
But, that's why I stick to one server. I won't go to any irc-d's :)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.