Konversation/Scripts/Ghosttrick: Difference between revisions
No edit summary |
(Marked this version for translation) |
||
Line 1: | Line 1: | ||
<languages /> | <languages /> | ||
<translate> | <translate> | ||
<!--T:1--> | |||
The settings of a network contain a "Commands" field which can be used to run input line commands upon a connection to that network being established. In that field, there's a special "%nick" variable available which expands into the current nickname. This can be combined with the | The settings of a network contain a "Commands" field which can be used to run input line commands upon a connection to that network being established. In that field, there's a special "%nick" variable available which expands into the current nickname. This can be combined with the | ||
/exec command to run an external script that evaluates whether the nickname is the desired nick, and if not, use '''Konversation's''' DCOP IPC interface to make it send the ghost command to nickserv. | /exec command to run an external script that evaluates whether the nickname is the desired nick, and if not, use '''Konversation's''' DCOP IPC interface to make it send the ghost command to nickserv. | ||
<!--T:2--> | |||
Hence, you would have to put something like this into the user-local scripts folder (~/.kde/share/apps/konversation/scripts), under the name "getnickback", and mark it as executable: | Hence, you would have to put something like this into the user-local scripts folder (~/.kde/share/apps/konversation/scripts), under the name "getnickback", and mark it as executable: | ||
<!--T:3--> | |||
; For KDE 3.5 use this here: | ; For KDE 3.5 use this here: | ||
<syntaxhighlight lang="php" line> | <syntaxhighlight lang="php" line> | ||
#!/bin/sh | #!/bin/sh | ||
<!--T:4--> | |||
nick=******** # your desired nickanme | nick=******** # your desired nickanme | ||
pass=******** # the according password | pass=******** # the according password | ||
<!--T:5--> | |||
# don't edit below # | # don't edit below # | ||
<!--T:6--> | |||
PORT=$1 | PORT=$1 | ||
SERVER=$2 | SERVER=$2 | ||
NICK=$4 | NICK=$4 | ||
<!--T:7--> | |||
# if your current assigned nick isn't the same as your desired one, ghost yourself and change nick | # if your current assigned nick isn't the same as your desired one, ghost yourself and change nick | ||
if [ "$NICK" != "$nick" ] | if [ "$NICK" != "$nick" ] | ||
Line 26: | Line 33: | ||
fi | fi | ||
<!--T:8--> | |||
# now identify yourself at the server | # now identify yourself at the server | ||
dcop $PORT default raw $SERVER "PRIVMSG nickserv :IDENTIFY $pass" | dcop $PORT default raw $SERVER "PRIVMSG nickserv :IDENTIFY $pass" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<!--T:9--> | |||
; As KDE 4 has changed to dbus instead of dcop use this version for KDE 4: | ; As KDE 4 has changed to dbus instead of dcop use this version for KDE 4: | ||
{{Input|<syntaxhighlight lang="php" line> | {{Input|<syntaxhighlight lang="php" line> | ||
#!/bin/sh | #!/bin/sh | ||
<!--T:10--> | |||
nick=******** # your desired nickanme | nick=******** # your desired nickanme | ||
pass=******** # the according password | pass=******** # the according password | ||
<!--T:11--> | |||
# don't edit below # | # don't edit below # | ||
<!--T:12--> | |||
CONNECTION=$1 | CONNECTION=$1 | ||
NICK=$3 | NICK=$3 | ||
<!--T:13--> | |||
# if your current assigned nick isn't the same as your desired one, ghost yourself and change nick | # if your current assigned nick isn't the same as your desired one, ghost yourself and change nick | ||
if [ "$NICK" != "$nick" ] | if [ "$NICK" != "$nick" ] | ||
Line 49: | Line 62: | ||
fi | fi | ||
<!--T:14--> | |||
# now identify yourself at the server | # now identify yourself at the server | ||
qdbus org.kde.konversation /irc raw $CONNECTION "PRIVMSG nickserv :IDENTIFY $pass" | qdbus org.kde.konversation /irc raw $CONNECTION "PRIVMSG nickserv :IDENTIFY $pass" | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
<!--T:15--> | |||
Notice the nick and password settings you need to fill in as you need them to be. Then, into the network's "Commands" field put <code>/exec getnickback %nick</code> | Notice the nick and password settings you need to fill in as you need them to be. Then, into the network's "Commands" field put <code>/exec getnickback %nick</code> | ||
<!--T:16--> | |||
[[Category:Internet]] | [[Category:Internet]] | ||
[[Category:Advanced Users]] | [[Category:Advanced Users]] | ||
</translate> | </translate> |
Revision as of 12:18, 25 July 2011
The settings of a network contain a "Commands" field which can be used to run input line commands upon a connection to that network being established. In that field, there's a special "%nick" variable available which expands into the current nickname. This can be combined with the /exec command to run an external script that evaluates whether the nickname is the desired nick, and if not, use Konversation's DCOP IPC interface to make it send the ghost command to nickserv.
Hence, you would have to put something like this into the user-local scripts folder (~/.kde/share/apps/konversation/scripts), under the name "getnickback", and mark it as executable:
- For KDE 3.5 use this here
#!/bin/sh
nick=******** # your desired nickanme
pass=******** # the according password
# don't edit below #
PORT=$1
SERVER=$2
NICK=$4
# if your current assigned nick isn't the same as your desired one, ghost yourself and change nick
if [ "$NICK" != "$nick" ]
then
dcop $PORT default raw $SERVER "PRIVMSG nickserv :GHOST $nick $pass"
dcop $PORT default raw $SERVER "/nick $nick"
fi
# now identify yourself at the server
dcop $PORT default raw $SERVER "PRIVMSG nickserv :IDENTIFY $pass"
- As KDE 4 has changed to dbus instead of dcop use this version for KDE 4
#!/bin/sh nick=******** # your desired nickanme pass=******** # the according password # don't edit below # CONNECTION=$1 NICK=$3 # if your current assigned nick isn't the same as your desired one, ghost yourself and change nick if [ "$NICK" != "$nick" ] then qdbus org.kde.konversation /irc raw $CONNECTION "PRIVMSG nickserv :GHOST $nick $pass" qdbus org.kde.konversation /irc raw $CONNECTION "NICK $nick" fi # now identify yourself at the server qdbus org.kde.konversation /irc raw $CONNECTION "PRIVMSG nickserv :IDENTIFY $pass"
Notice the nick and password settings you need to fill in as you need them to be. Then, into the network's "Commands" field put /exec getnickback %nick