konversation script slap


slapkonversation

CREATING SCRIPTS

i was chatting with some guys and they have told me that they used xchat instead of konversation for script and other nerd
stuff ….

so …. here it is

put this script in this folder $HOME/.kde/share/apps/konversation/scripts/

you can do this with :

NOTE that you could have .kde4 instead of .kde
NOTE that scripts folder COULD NOT exist so if you need type mkdir $HOME/.kde/share/apps/konversation/scripts
NOTE THAT SCRIPTS NEED TO BE EXECUTABLE !

 wget https://kde-peace-settings.googlecode.com/git/konversation%20scripts/slap -O $HOME/.kde/share/apps/konversation/scripts/slap ; chmod +x $HOME/.kde/share/apps/konversation/scripts/slap 

USAGE

type /slap nickname

if you have saved in another name  type

/scriptname nickname parameters

NOTE that for bash spaces are a parameter so use 1 space😀 !

ALIAS ON KONVERSATION

Another little dirty trick for konversation if you need fast alias for command like

/cs op NICKNAME

there is a simple way to do that on konversation just go on settings => configure konversation => command aliases and just type what you need to type

for example
konvesation

RUNNING EXTERNAL PROGRAMS ON KONVERSATION

another little trick for who is using konversation very often if you need to paste a command just do this

/cmd lsusb | pastebinit

it just does what you need .

here there is the code if you need just for reference KONVERSATION SENDS PARAMETERS AUTOMATICALLY THE FIRST IT’S THE NAME OF THE SCRIPT THE SECOND IT’S THE CHANNEL AND THE LAST ONE OR OTHERS ARE USER PARAMETERS LIKE NICKNAME ETC …. , if you have saved this script like slap you can type

/slap nickname and conversation will launch the script in this way
slap 0 “#channel” “nickname”

PLEASE IN BASH MAKE SURE YOU HAVE NOT PUT DOUBLE SPACE OR IT WILL NOT WORK

 #!/bin/bash

#Copyright (C) 2012 nowardev nowardev@gmail.com

#This file is part of kde-peace-settings.

#kde-peace-settings is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program.  If not, see <http://www.gnu.org/licenses/>.

slaptext=("an alien ware big-tower." "an SuSE 9.2 Professional manual." "the full perldoc." "a back to the future." "a crowbar (uhhh, that hurts!)." "a rather large squid" "a hydraulic pump" "a book by Stephen King" "a 10mbit network card" "a ladies handbag" "some girl scouts" "a football team" "a bottle" "a yellow marsh-mellow" "a match" "the queen of England" "a taxi" "100 feet of wire" "a bag of Cheerios" "a hat" "a fist" "the back hand" "the forehead" "a computer monitor" "a coconut" "a microphone" "a cellphone" "a snowplough" "a doggy" "Bill Clinton" "a stone" "a club. With a nail in it" "a small asteroid, rich in iron" "a small interstellar spaceship" "a fresh zucchini" "a laptop" "a big dictionary" "a baseball bat" "Never Net" "some porn" "a mIRC script" "a canoe" "a tortoise" "a horse" "the book of Kells" "Tin-tin's father, Hergé" "a whale" "a rubber dildo" "a well groomed poodle" "a channel operator" "a news paper (New York Times Sunday Edition)" "a gnarly werewolf" "a vampire. They really suck" "a Perl script" "a bag of doggie chow" "a fat walrus" "an IPv6 address" "a catholic priest" "James Dean" "Ronald MacDonald (he *IS* good for something)" "Autoconf version 2.13" "a PRIVMSG" "an email address" "some ANSI color codes" "a thermonuclear weapon. Ye haw" "the hitch hikers guide to the galaxy, revised edition" "Nessie, the Loch Ness monster" "a tuna. Still in the can! *BONK* That will leave a mark" "a few fluffy pillows" "a red Chinese dragon" "a linux-manual (signed by L. Torvalds)" "Stage1" "Bill Gates underpants" "GM Abraham and the whole OW-Staff" "Sphere 1.0" "a Linux kernel" "Lenin's Collected Works" "Stalin's Collected Works" "a iron Tux" "a glowing 23" "your mum (CLEAN YOUR ROOM!)" "a complete GNOME-Documentation" "a Portage-tree" "thand[Z]'s transparent Tanga" "a Kernel panic" "Windoze XP" "an AK-47 (die, you imperialist dog!)" "a bag full with Michael Jackson's dropped noses" "an NBP-Manifesto (Hail Limo-new! Hail our Leader! Hail!)" "an NBP-Flag (Lead us to freedom, Leader Limo-new!)" "Mein Kampf (Doppelausgabe, Hardcover)" "Invader Zim's iron fist" "some ASCII-Arts" "The Family Learning Channel" "GOD" "Dorian Grey's picture" "some unlocked Grenades *BOOM*" "the Win2k Bug list")

RANGE="${#slaptext[@]}"

echo

number=$RANDOM
let "number %= $RANGE"
#           ^^
# message=" "
message="${slaptext["$number"]}"

#konversation send $1 = 0 $2 = channel  $3 your typed nickname so to run this script if you saved like slap type on konversation
#/slap nicknamefriend
qdbus org.kde.konversation /irc say irc.ubuntu.com "$2" "/me  slaps $3 with $message"
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: