Jump to content

Konversation/Scripts/Ghosttrick/uk: Difference between revisions

From KDE UserBase Wiki
Yurchor (talk | contribs)
Created page with "Отже вам слід зберегти один з наведених нижче скриптів до теки скриптів користувача (<code>~/.kde/share/app..."
FuzzyBot (talk | contribs)
Updating to match new version of source page
Line 29: Line 29:
</syntaxhighlight>
</syntaxhighlight>


<span class="mw-translate-fuzzy">
; Оскільки у KDE 4 D-Bus замінив собою DCOP, у KDE 4 слід користуватися цією версією:
; Оскільки у KDE 4 D-Bus замінив собою DCOP, у KDE 4 слід користуватися цією версією:
<!--}}-->{{Input|<syntaxhighlight lang="php" line>
<!--}}-->{{Input|<syntaxhighlight lang="php" line>
#!/bin/sh
#!/bin/sh
</span>


nick=********          # your desired nickanme
nick=********          # your desired nickanme
Line 50: Line 52:
# 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>}}<!--{{-->


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>

Revision as of 14:23, 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.

Отже вам слід зберегти один з наведених нижче скриптів до теки скриптів користувача (~/.kde/share/apps/konversation/scripts) під назвою "getnickback" і позначити файл для виконання:

У KDE 3.5 використовуйте такий скрипт
#!/bin/sh

nick=********           # бажаний псевдонім
pass=********           # відповідний пароль

# текст нижче не змінюйте #

PORT=$1
SERVER=$2
NICK=$4

# якщо ваш поточний псевдонім не збігається з бажаним, приховатися і змінити псевдонім
if [ "$NICK" != "$nick" ]
then
  dcop $PORT default raw $SERVER "PRIVMSG nickserv :GHOST $nick $pass"
  dcop $PORT default raw $SERVER "/nick $nick"
fi

# ідентифікувати себе на сервері
dcop $PORT default raw $SERVER "PRIVMSG nickserv :IDENTIFY $pass"

Оскільки у KDE 4 D-Bus замінив собою DCOP, у KDE 4 слід користуватися цією версією
'"`UNIQ--syntaxhighlight-00000003-QINU`"'

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