Вы находитесь на странице: 1из 33

8/19/2016 fast666.jw.

lt/kamus

EggdropTclCommands
Lastrevised:June04,2002
_________________________________________________________________

ThisisanexhaustivelistofalltheTclcommandsaddedtoEggdrop.All
ofthenormalTclbuiltincommandsarestillthere,ofcourse,butyou
canalsousethesetomanipulatefeaturesofthebot.Theyarelisted
accordingtocategory.

ThislistisaccurateforEggdropv1.6.11.Scriptswrittenforv1.3/v1.4
seriesofEggdropshouldprobablyworkwithafewminormodifications
dependingonthescript.Scriptswhichwerewrittenforv0.9,v1.0,v1.1
orv1.2willprobablynotworkwithoutmodification.Commandswhichhave
beenchangedinthisversionofEggdrop(orarejustnewcommands)are
markedwithverticalbars(|)ontheleft.

***OUTPUTCOMMANDS***

putserv<text>[options]
Description:sendstexttotheserver,like'.dump'(intendedfordirect
servercommands);outputisqueuedsothatthebotwon'tflooditself
offtheserver.
Options:
next:pushmessagestothefrontofthequeue
normal:noeffect
Returns:nothing
Module:server

puthelp<text>[options]
Description:sendstexttotheserver,like'putserv',butitusesa
differentqueueintendedforsendingmessagestochannelsorpeople.
Options:
next:pushmessagestothefrontofthequeue
normal:noeffect
Returns:nothing
Module:server

putquick<text>[options]
Description:sendstexttotheserver,like'putserv',butitusesa
different(andfaster)queue.
Options:
next:pushmessagestothefrontofthequeue
normal:noeffect
Returns:nothing
Module:server

putkick<channel><nick,nick,...>[reason]
Description:sendskickstotheserverandtriestoputasmanynicks
intoonekickcommandaspossible.
Returns:nothing
Module:irc

putlog<text>
Description:sendstexttothebot'slogfile,markedas'misc'(o)
Returns:nothing
Module:core

putcmdlog<text>
Description:sendstexttothebot'slogfile,markedas'command'(c)
Returns:nothing
Module:core

putxferlog<text>
Description:sendstexttothebot'slogfile,markedas'filearea'(x)
Returns:nothing
Module:core

putloglev<level(s)><channel><text>
http://fast666.jw.lt/kamus 1/33
8/19/2016 fast666.jw.lt/kamus

Description:sendstexttothebot'slogfile,taggedwithallofthe
validlevelsgiven.Use"*"toindicateallloglevels.
Returns:nothing
Module:core

dumpfile<nick><filename>
Description:dumpsfilefromthehelp/textdirectorytoauseronIRCvia
msg(onelinepermsg).Theuserhasnoflags,sotheflagbindings
won'tworkwithinthefile.
Returns:nothing
Module:core

queuesize[queue]
Returns:thenumberofmessagesinallqueues.Ifaqueueisspecified,
onlythesizeofthisqueueisreturned.Validqueuesare:mode,
server,help.
Module:server

clearqueue<queue>
Description:removesallmessagesfromaqueue.Validargumentsare:
mode,server,help,orall.
Returns:thenumberofdeletedlinesfromthespecifiedqueue.
Module:server

***USERRECORDMANIPULATIONCOMMANDS***

countusers
Returns:numberofusersinthebot'sdatabase
Module:core

validuser<handle>
Returns:1ifauserbythatnameexists;0otherwise
Module:core

finduser<nick!user@host>
Description:findstheuserrecordwhichmostcloselymatchesthegiven
nick!user@host
Returns:thehandlefound,or"*"ifnone
Module:core

userlist[flags]
Returns:alistofusersonthebot.Youcanusetheflagmatching
systemhere([global]{&/|}[chan]{&/|}[bot]).'&'specifies"and";
'|'specifies"or".
Module:core

passwdok<handle><pass>
Description:checksthepasswordgivenagainsttheuser'spassword.
Checkagainstthepassword""(ablankstring)or""tofindout
ifauserhasnopasswordset.
Returns:1ifthepasswordmatchesforthatuser;0otherwise
Module:core

getuser<handle><entrytype>[extrainfo]
Description:aninterfacetothenewgenericuserfilesupport.Valid
entrytypesare:
BOTFLreturnsthecurrentbotspecificflagsfortheuser
(botonly)
BOTADDRreturnsalistcontainingthebot'saddress,telnetport,
andrelayport(botonly)
HOSTSreturnsalistofhostsfortheuser
LASTONreturnsalistcontainingtheunixtimelastseenandthe
lastseenplace.LASTON#channelreturnsthetimelast
seentimeforthechannelor0ifnoinfoexists.
INFOreturnstheuser'sglobalinfoline
XTRAreturnstheuser'sXTRAinfo
COMMENTreturnsthemastervisibleonlycommentfortheuser
EMAILreturnstheuser'semailaddress

http://fast666.jw.lt/kamus 2/33
8/19/2016 fast666.jw.lt/kamus

URLreturnstheuser'surl
HANDLEreturnstheuser'shandleasitissavedintheuserfile
PASSreturnstheuser'sencryptedpassword
Returns:infospecifictoeachentrytype
Module:core

setuser<handle><entrytype>[extrainfo]
Description:thisisthecounterpartofgetuser.Itletsyousetthe
variousvalues.Otherthentheoneslistedbelow,theentrytypesare
thesameasgetuser's.
PASSsetsauserspassword(nothirdargwillclearit)
HOSTSifusedwithnothirdarg,allhostsfortheuserwillbe
becleared.Otherwise,*1*hostmaskisadded:P
LASTONThissettinghas3forms."setuser<handle>LASTON
<unixtime><place>"setsglobalLASTONtime,"setuser
<handle>LASTON<unixtime>"setsglobalLASTONtime
(leavingtheplacefieldempty),and"setuser<handle>
LASTON<unixtime><channel>"setsausersLASTONtimefor
achannel(ifitisavalidchannel).
Returns:nothing
Module:core

chhandle<oldhandle><newhandle>
Description:changesauser'shandle
Returns:1onsuccess;0ifthenewhandleisinvalidoralreadyused,
oriftheusercan'tbefound
Module:core

chattr<handle>[changes[channel]]
Description:changestheattributesforauserrecord,ifyouincludeany.
Changesareoftheform'+f','o','+dk','o+d',etc.Ifchangesare
specifiedintheformatof|<changes><channel>,thechannelspecific
flagsforthatchannelarealtered.Youcannowusethe+o|o#channel
formatheretoo.
Returns:newflagsfortheuser(ifyoumadenochanges,thecurrent
flagsarereturned).Ifachannelwasspecified,theglobalANDthe
channelspecificflagsforthatchannelarereturnedintheformatof
globalflags|channelflags."*"isreturnedifthespecifieduserdoes
notexist.
Module:core

botattr<handle>[changes[channel]]
Description:similartochattrexceptthismodifiesbotflagsrather
thannormaluserattributes.
Returns:newflagsforthebot(ifyoumadenochanges,thecurrent
flagsarereturned).Ifachannelwasspecified,theglobalANDthe
channelspecificflagsforthatchannelarereturnedintheformatof
globalflags|channelflags."*"isreturnedifthespecifiedbotdoes
notexist.
Module:core

matchattr<handle><flags>[channel]
Returns:1ifthespecifieduserhasthespecifiedflags;0otherwise
Module:core

adduser<handle>[hostmask]
Description:createsanewuserentrywiththehandleandhostmaskgiven
(withnopasswordandthedefaultflags)
Returns:1ifsuccessful;0ifthehandlealreadyexists
Module:core

addbot<handle><address>
Description:addsanewbottotheuserlistwiththehandleandbot
addressgiven(withnopasswordandnoflags)
Returns:1ifsuccessful;0ifthebotalreadyexists
Module:core

deluser<handle>
Description:attemptstoerasetheuserrecordforahandle

http://fast666.jw.lt/kamus 3/33
8/19/2016 fast666.jw.lt/kamus

Returns:1ifsuccessful,0ifnosuchuserexists
Module:core

delhost<handle><hostmask>
Description:deletesahostmaskfromauser'shostlist
Returns:1onsuccess;0ifthehostmask(oruser)doesn'texist
Module:core

addchanrec<handle><channel>
Description:addsachannelrecordforauser
Returns:1onsuccess;0iftheuserorchanneldoesnotexist
Module:channels

delchanrec<handle><channel>
Description:removesachannelrecordforauser.Thisincludesall
associatedchannelflags.
Returns:1onsuccess;0iftheuserorchanneldoesnotexist
Module:channels

haschanrec<handle><channel>
Returns:1ifthegivenhandlehasachanrecforthespecifiedchannel;
0otherwise
Module:channels

getchaninfo<handle><channel>
Returns:infolineforaspecificchannel(behavesjustlike'getinfo')
Module:channels

setchaninfo<handle><channel><info>
Description:setstheinfolineonaspecificchannelforauser.If
infois"none",itwillberemoved.
Returns:nothing
Module:channels

newchanban<channel><ban><creator><comment>[lifetime][options]
Description:addsabantothebanlistofachannel;creatorisgiven
creditforthebaninthebanlist.lifetimeisspecifiedin
minutes.Iflifetimeisnotspecified,bantime(usually60)is
used.Settingthelifetimeto0makesitapermanentban.
Options:
sticky:forcesthebantobealwaysactiveonachannel,even
withdynamicbanson
none:noeffect
Returns:nothing
Module:channels

newban<ban><creator><comment>[lifetime][options]
Description:addsabantotheglobalbanlist(whichtakeseffecton
allchannels);creatorisgivencreditforthebaninthebanlist.
lifetimeisspecifiedinminutes.Iflifetimeisnotspecified,
bantime(usually60)isused.Settingthelifetimeto0makesita
permanentban.
Options:
sticky:forcesthebantobealwaysactiveonachannel,even
withdynamicbanson
none:noeffect
Returns:nothing
Module:channels

newchanexempt<channel><exempt><creator><comment>[lifetime][options]
Description:addsaexempttotheexemptlistofachannel;creatoris
givencreditfortheexemptintheexemptlist.lifetimeisspecified
inminutes.Iflifetimeisnotspecified,exempttime(usually60)is
used.Settingthelifetimeto0makesitapermanentexempt.Theexempt
willnotberemoveduntilthecorrespondingbanhasbeenremoved.For
timedbans,oncethetimeperiodhasexpired,theexemptwillnotbe
removeduntilthecorrespondingbanhaseitherexpiredorbeenremoved.
Options:
sticky:forcestheexempttobealwaysactiveonachannel,even

http://fast666.jw.lt/kamus 4/33
8/19/2016 fast666.jw.lt/kamus

withdynamicexemptson
none:noeffect
Returns:nothing
Module:channels

newexempt<exempt><creator><comment>[lifetime][options]
Description:addsaexempttotheglobalexemptlist(whichtakeseffect
onallchannels);creatorisgivencreditfortheexemptintheexempt
list.lifetimeisspecifiedinminutes.Iflifetimeisnotspecified,
exempttime(usually60)isused.Settingthelifetimeto0makesita
permanentexempt.Theexemptwillnotberemoveduntilthe
correspondingbanhasbeenremoved.
Options:
sticky:forcestheexempttobealwaysactiveonachannel,even
withdynamicexemptson
none:noeffect
Returns:nothing
Module:channels

newchaninvite<channel><invite><creator><comment>[lifetime][options]
Description:addsainvitetotheinvitelistofachannel;creatoris
givencreditfortheinviteintheinvitelist.lifetimeisspecified
inminutes.Iflifetimeisnotspecified,invitetime(usually60)is
used.Settingthelifetimeto0makesitapermanentinvite.Theinvite
willnotberemoveduntilthechannelhasgonei.
Options:
sticky:forcestheinvitetobealwaysactiveonachannel,even
withdynamicinviteson
none:noeffect
Returns:nothing
Module:channels

newinvite<invite><creator><comment>[lifetime][options]
Description:addsainvitetotheglobalinvitelist(whichtakeseffect
onallchannels);creatorisgivencreditfortheinviteintheinvite
list.lifetimeisspecifiedinminutes.Iflifetimeisnotspecified,
invitetime(usually60)isused.Settingthelifetimeto0makesit
apermanentinvite.Theinvitewillnotberemoveduntilthechannel
hasgonei.
Options:
sticky:forcestheinvitetobealwaysactiveonachannel,even
withdynamicinviteson
none:noeffect
Returns:nothing
Module:channels

stick<banmask>[channel]
Description:makesabansticky,or,ifachannelisspecified,thenit
issetstickyonthatchannelonly.
Returns:1onsuccess;0otherwise
Module:channels

unstick<banmask>[channel]
Description:makesabannolongersticky,or,ifachannelis
specified,thenitisunstuckonthatchannelonly.
Returns:1onsuccess;0otherwise
Module:channels

stickexempt<exemptmask>[channel]
Description:makesanexemptsticky,or,ifachannelisspecified,
thenitissetstickyonthatchannelonly.
Returns:1onsuccess;0otherwise
Module:channels

unstickexempt<exemptmask>[channel]
Description:makesanexemptnolongersticky,or,ifachannelis
specified,thenitisunstuckonthatchannelonly.
Returns:1onsuccess;0otherwise
Module:channels

http://fast666.jw.lt/kamus 5/33
8/19/2016 fast666.jw.lt/kamus

stickinvite<invitemask>[channel]
Description:makesaninvitesticky,or,ifachannelisspecified,
thenitissetstickyonthatchannelonly.
Returns:1onsuccess;0otherwise
Module:channels

unstickinvite<invitemask>[channel]
Description:makesaninvitenolongersticky,or,ifachannelis
specified,thenitisunstuckonthatchannelonly.
Returns:1onsuccess;0otherwise
Module:channels

killchanban<channel><ban>
Description:removesabanfromthebanlistforachannel
Returns:1onsuccess;0otherwise
Module:channels

killban<ban>
Description:removesabanfromtheglobalbanlist
Returns:1onsuccess;0otherwise
Module:channels

killchanexempt<channel><exempt>
Description:removesanexemptfromtheexemptlistforachannel
Returns:1onsuccess;0otherwise
Module:channels

killexempt<exempt>
Description:removesanexemptfromtheglobalexemptlist
Returns:1onsuccess;0otherwise
Module:channels

killchaninvite<channel><invite>
Description:removesaninvitefromtheinvitelistforachannel
Returns:1onsuccess;0otherwise
Module:channels

killinvite<invite>
Description:removesaninvitefromtheglobalinvitelist
Returns:1onsuccess;0otherwise
Module:channels

ischanjuped[channel]
Returns:1ifthechannelisjuped,andthebotisunabletojoin;0
otherwise
Module:channels

isban<ban>[channel]
Returns:1ifthespecifiedbanisintheglobalbanlist;0otherwise.
Ifachannelisspecified,thatchannel'sbanlistischeckedaswell.
Module:channels

ispermban<ban>[channel]
Returns:1ifthespecifiedbanisintheglobalbanlistANDismarked
aspermanent;0otherwise.Ifachannelisspecified,thatchannel's
banlistischeckedaswell.
Module:channels

isexempt<exempt>[channel]
Returns:1ifthespecifiedexemptisintheglobalexemptlist;0
otherwise.Ifachannelisspecified,thatchannel'sexemptlistis
checkedaswell.
Module:channels

ispermexempt<exempt>[channel]
Returns:1ifthespecifiedexemptisintheglobalexemptlistANDis
markedaspermanent;0otherwise.Ifachannelisspecified,that
channel'sexemptlistischeckedaswell.

http://fast666.jw.lt/kamus 6/33
8/19/2016 fast666.jw.lt/kamus

Module:channels

isinvite<invite>[channel]
Returns:1ifthespecifiedinviteisintheglobalinvitelist;0
otherwise.Ifachannelisspecified,thatchannel'sinvitelistis
checkedaswell.
Module:channels

isperminvite<invite>[channel]
Returns:1ifthespecifiedinviteisintheglobalinvitelistANDis
markedaspermanent;0otherwise.Ifachannelisspecified,that
channel'sinvitelistischeckedaswell.
Module:channels

isbansticky<ban>[channel]
Returns:1ifthespecifiedbanismarkedasstickyintheglobalban
list;0otherwise.Ifachannelisspecified,thatchannel'sbanlist
ischeckedaswell.
Module:channels

isexemptsticky<exempt>[channel]
Returns:1ifthespecifiedexemptismarkedasstickyintheglobal
exemptlist;0otherwise.Ifachannelisspecified,thatchannel's
exemptlistischeckedaswell.
Module:channels

isinvitesticky<invite>[channel]
Returns:1ifthespecifiedinviteismarkedasstickyintheglobal
invitelist;0otherwise.Ifachannelisspecified,thatchannel's
invitelistischeckedaswell.
Module:channels

matchban<nick!user@host>[channel]
Returns:1ifthespecifiednick!user@hostmatchesabanintheglobal
banlist;0otherwise.Ifachannelisspecified,thatchannel'sban
listischeckedaswell.
Module:channels

matchexempt<nick!user@host>[channel]
Returns:1ifthespecifiednick!user@hostmatchesanexemptinthe
globalexemptlist;0otherwise.Ifachannelisspecified,that
channel'sexemptlistischeckedaswell.
Module:channels

matchinvite<nick!user@host>[channel]
Returns:1ifthespecifiednick!user@hostmatchesaninviteinthe
globalinvitelist;0otherwise.Ifachannelisspecified,that
channel'sinvitelistischeckedaswell.
Module:channels

banlist[channel]
Returns:alistofglobalbans,or,ifachannelisspecified,a
listofchannelspecificbans.Eachentryisasublistcontaining:
hostmask,comment,expirationtimestamp,timeadded,lasttime
active,andcreator.Thethreetimestampsareinunixtimeformat.
Module:channels

exemptlist[channel]
Returns:alistofglobalexempts,or,ifachannelisspecified,a
listofchannelspecificexempts.Eachentryisasublistcontaining:
hostmask,comment,expirationtimestamp,timeadded,lasttime
active,andcreator.Thethreetimestampsareinunixtimeformat.
Module:channels

invitelist[channel]
Returns:alistofglobalinvites,or,ifachannelisspecified,a
listofchannelspecificinvites.Eachentryisasublistcontaining:
hostmask,comment,expirationtimestamp,timeadded,lasttime
active,andcreator.Thethreetimestampsareinunixtimeformat.

http://fast666.jw.lt/kamus 7/33
8/19/2016 fast666.jw.lt/kamus

Module:channels

newignore<hostmask><creator><comment>[lifetime]
Description:addsanentrytotheignorelist;creatorisgivencredit
fortheignore.lifetimeishowmanyminutesuntiltheignoreexpires
andisremoved.Iflifetimeisnotspecified,ignoretime(usually60)
isused.Settingthelifetimeto0makesitapermanentignore.
Returns:nothing
Module:core

killignore<hostmask>
Description:removesanentryfromtheignorelist
Returns:1ifsuccessful;0otherwise
Module:core

ignorelist
Returns:alistofignores.Eachentryisasublistcontaining:
hostmask,comment,expirationtimestamp,timeadded,andcreator.
Thetimestampsareinunixtimeformat.
Module:core

isignore<hostmask>
Returns:1iftheignoreisinthelist;0otherwise
Module:core

save
Description:writestheuserandchannelfilestodisk
Returns:nothing
Module:core

reload
Description:loadstheuserfilefromdisk,replacingwhateverisin
memory
Returns:nothing
Module:core

backup
Description:makesasimplebackupoftheuserfilethat'sondisk.
Ifthechannelsmoduleisloaded,thisalsomakesasimplebackup
ofthechannelfile.
Returns:nothing
Module:core

gettingusers
Returns:1ifthebotiscurrentlydownloadingauserfilefrom
asharebot(andhence,userrecordsareabouttodrastically
change);0ifnot
Module:core

***CHANNELCOMMANDS***

channeladd<name><optionlist>
Description:addsachannelrecordforthebottomonitor.Thefull
listofpossibleoptionsaregivenindoc/settings.mod.channels.Note
thatthechanneloptionsmustbeinalist(enclosedin{}).
Returns:nothing
Module:channels

channelset<name><options...>
Description:setsoptionsforthechannelspecified.Thefulllistof
possibleoptionsaregivenindoc/settings.mod.channels.
Returns:nothing
Module:channels

channelinfo<name>
Returns:alistofinfoaboutthespecifiedchannel'ssettings.
Module:channels

|channelget<name><setting>

http://fast666.jw.lt/kamus 8/33
8/19/2016 fast666.jw.lt/kamus

|Returns:Thevalueofthesettingyouspecify.Forflags,avalueof0
|meansitisdisabled(),andnonzeromeansenabled(+).
|Module:channels

channelremove<name>
Description:removesachannelrecordfromthebotandmakesthebotno
longermonitorthechannel
Returns:nothing
Module:channels

savechannels
Description:savesthechannelsettingstothechannelfileifoneis
defined.
Returns:nothing
Module:channels

loadchannels
Description:reloadsthechannelsettingsfromthechannelfileifone
isdefined.
Returns:nothing
Module:channels

channels
Returns:alistofthechannelsthebothasachannelrecordfor
Module:channels

channame2dname<channelname>
chandname2name<channeldname>
Description:thesetwofunctionsareimportanttocorrectlysupport
!channels.Thebotdifferentiatesbetweenchanneldescriptionnames
(chandnames)andrealchannelnames(channames).Thechandnames
arewhatyouwouldnormallycallthechannel,suchas"!channel".The
channamesarewhattheIRCserverusestoidentifythechannel.They
consistofthechandnameprefixedwithanID;suchas"!ABCDEchannel".

Forbotfunctionslikeisop,isvoice,etc.youneedtoknowthechan
dnames.Ifyoucommunicatewiththeserver,youusuallygetthechan
name,though.That'swhatyouneedthechanname2dnamefunctionfor.

Ifyouonlyhavethechandnameandwanttodirectlysendrawserver
commands,usethechandname2namecommand.

NOTE:Fornon!channels,chandnameandchannamearethesame.
Module:irc

isbotnick<nick>
Returns:1ifthenickmatchesthebotnick;0otherwise
Module:server

botisop[channel]
Returns:1ifthebothasopsonthespecifiedchannel(oranychannel
ifnochannelisspecified);0otherwise
Module:irc

|botishalfop[channel]
|Returns:1ifthebothashalfopsonthespecifiedchannel(oranychannel
|ifnochannelisspecified);0otherwise
|Module:irc

botisvoice[channel]
Returns:1ifthebothasavoiceonthespecifiedchannel(orany
channelifnochannelisspecified);0otherwise
Module:irc

botonchan[channel]
Returns:1ifthebotisonthespecifiedchannel(oranychannelif
nochannelisspecified);0otherwise
Module:irc

http://fast666.jw.lt/kamus 9/33
8/19/2016 fast666.jw.lt/kamus

isop<nickname>[channel]
Returns:1ifsomeonebythespecifiednicknameisonthechannel(or
anychannelifnochannelnameisspecified)andhasops;0otherwise
Module:irc

|ishalfop<nickname>[channel]
|Returns:1ifsomeonebythespecifiednicknameisonthechannel(or
|anychannelifnochannelnameisspecified)andhashalfops;0otherwise
|Module:irc

wasop<nickname><channel>
Returns:1ifsomeonethatjustgotopped/deoppedinthechanhadop
beforethemodechange;0otherwise
Module:irc

|washalfop<nickname><channel>
|Returns:1ifsomeonethatjustgothalfopped/dehalfoppedinthechan
|hadhalfopbeforethemodechange;0otherwise
|Module:irc

isvoice<nickname>[channel]
Returns:1ifsomeonebythatnicknameisonthechannel(orany
channelifnochannelisspecified)andhasvoice(+v);0otherwise
Module:irc

onchan<nickname>[channel]
Returns:1ifsomeonebythatnicknameisonthespecifiedchannel(or
anychannelifnoneisspecified);0otherwise
Module:irc

nick2hand<nickname>[channel]
Returns:thehandleofanicknameonachannel.Ifachannelisnot
specified,thebotwillcheckallofitschannels.Ifthenickis
notfound,""isreturned.Ifthenickisfoundbutdoesnothave
ahandle,"*"isreturned.
Module:irc

hand2nick<handle>[channel]
Returns:nicknameofthefirstpersononthespecifiedchannel(ifone
isspecified)whosenick!user@hostmatchesthegivenhandle;""is
returnedifnomatchisfound.Ifnochannelisspecified,allchannels
arechecked.
Module:irc

handonchan<handle>[channel]
Returns:1ifthethenick!user@hostforsomeoneonthechannel(orany
channelifnochannelnameisspecified)matchesforthehandlegiven;
0otherwise
Module:irc

ischanban<ban><channel>
Returns:1ifthespecifiedbanisonthegivenchannel'sbanlist
(notthebot'sbanlistforthechannel)
Module:irc

ischanexempt<exempt><channel>
Returns:1ifthespecifiedexemptisonthegivenchannel'sexempt
list(notthebot'sexemptlistforthechannel)
Module:irc

ischaninvite<invite><channel>
Returns:1ifthespecifiedinviteisonthegivenchannel'sinvite
list(notthebot'sinvitelistforthechannel)
Module:irc

chanbans<channel>
Returns:alistofthecurrentbansonthechannel.Eachelementis
asublistoftheform{<ban><bywho><age>}.ageissecondsfromthe
bot'sPOV.

http://fast666.jw.lt/kamus 10/33
8/19/2016 fast666.jw.lt/kamus

Module:irc

chanexempts<channel>
Returns:alistofthecurrentexemptsonthechannel.Eachelementis
asublistoftheform{<exempts><bywho><age>}.ageissecondsfromthe
bot'sPOV.
Module:irc

chaninvites<channel>
Returns:alistofthecurrentinvitesonthechannel.Eachelementis
asublistoftheform{<invites><bywho><age>}.ageissecondsfromthe
bot'sPOV.
Module:irc

resetbans<channel>
Description:removesallbansonthechannelthataren'tinthebot's
banlistandrefreshesanybansthatshouldbeonthechannelbut
aren't
Returns:nothing
Module:irc

resetexempts<channel>
Description:removesallexemptonthechannelthataren'tinthebot's
exemptlistandrefreshesanyexemptsthatshouldbeonthechannel
butaren't
Returns:nothing
Module:irc

resetinvites<channel>
Description:removesallinvitesonthechannelthataren'tinthebot's
invitelistandrefreshesanyinvitesthatshouldbeonthechannel
butaren't
Returns:nothing
Module:irc

resetchan<channel>
Description:rereadsinthechannelinfofromtheserver
Returns:nothing
Module:irc

getchanhost<nickname>[channel]
Returns:user@hostofthespecifiednickname(thenicknameisnotincluded
inthereturnedhost).Ifachannelisnotspecified,botwillcheck
allofitschannels.Ifthenicknameisnotonthechannel(s),""is
returned.
Module:irc

getchanjoin<nickname><channel>
Returns:timestamp(unixtimeformat)ofwhenthespecifiednickname
joinedthechannel
Module:irc

onchansplit<nick>[channel]
Returns:1ifthatnickissplitfromthechannel(oranychannelifno
channelisspecified);0otherwise
Module:irc

chanlist<channel>[flags[&chanflags]]
Description:flagsareanyglobalflags;the'&'denotestolookfor
channelspecificflags.Examples:
n(GlobalOwner)
&n(ChannelOwner)
o&m(GlobalOp,ChannelMaster)
Nowyoucanuseevenmorecomplexmatchingofflags,including+&flags
and&or|(andoror)matching.
Returns:listofnicknamescurrentlyonthebot'schannelthathaveall
oftheflagsspecified;.Ifnoflagsaregiven,allofthenicknames
arereturned.Pleasenotethatifyou'reexecutingchanlistaftera
partorsignbind,thegoneuserwillstillbelisted,soyoucan

http://fast666.jw.lt/kamus 11/33
8/19/2016 fast666.jw.lt/kamus

checkforwasop,isop,etc.
Module:irc

getchanidle<nickname><channel>
Returns:numberofminutesthatpersonhasbeenidle;0ifthe
specifieduserisn'tonthechannel
Module:irc

getchanmode<channel>
Returns:stringofthetype"+ntikkey"forthechannelspecified
Module:irc

jump[server[port[password]]]
Description:jumpstotheserverspecified,or(ifnoneisspecified)
thenextserverinthebot'sserverlist
Returns:nothing
Module:server

pushmode<channel><mode>[arg]
Description:sendsoutachannelmodechange(ex:pushmode#lame+o
goober)throughthebot'squeuingsystem.Allthemodechangeswill
besentoutatonce(combinedintoonelineasmuchaspossible)after
thescriptfinishes,orwhen'flushmode'iscalled.
Returns:nothing
Module:irc

flushmode<channel>
Description:forcesallpreviouslypushedchannelmodechangestobe
senttotheserver,insteadofwhenthescriptisfinished(justfor
thechannelspecified)
Returns:nothing
Module:irc

topic<channel>
Returns:stringcontainingthecurrenttopicofthespecifiedchannel
Module:irc

validchan<channel>
Description:checksifthebothasachannelrecordforthespecified
channel.NotethatthisdoesnotnecessarilymeanthatthebotisON
thechannel.
Returns:1ifthechannelexists,0ifnot
Module:channels

isdynamic<channel>
Returns:1ifthechannelisadynamicchannel;0otherwise
Module:channels

setudef<flag/int><name>
Description:initializesauserdefinedchannelflagorintegersetting.
Youcanuseitlikeanyotherflag/setting.IMPORTANT:Don'tforgetto
reinitializeyourflags/settingsafterarestart,orit'llbelost.
Returns:nothing
Module:channels

renudef<flag/int><oldname><newname>
Description:renamesauserdefinedchannelflagorintegersetting.
Returns:nothing
Module:channels

deludef<flag/int><name>
Description:deletesauserdefinedchannelflagorintegersetting.
Returns:nothing
Module:channels

***DCCCOMMANDS***

putdcc<idx><text>

http://fast666.jw.lt/kamus 12/33
8/19/2016 fast666.jw.lt/kamus

Description:sendstexttotheidxspecified
Returns:nothing
Module:core

dccbroadcast<message>
Description:sendsamessagetoeveryoneonthepartylineacrossthe
botnet,intheformof"***<message>"forlocalusersand
"***(Bot)<message>"forusersonotherbots
Returns:nothing
Module:core

dccputchan<channel><message>
Description:sendsyourmessagetoeveryoneonacertainchannelonthe
botnet,inaformexactlylikedccbroadcastdoes.Validchannelsare0
through99999.
Returns:nothing
Module:core

boot<user@bot>[reason]
Description:bootsauserfromthepartyline
Returns:nothing
Module:core

dccsimul<idx><text>
Description:simulatestexttypedinbythedccuserspecified.Note
thatinv0.9,thisonlysimulatedcommands;nowacommandmustbe
precededbya'.'tobesimulated.
Returns:nothing
Module:core

hand2idx<handle>
Returns:theidx(anumbergreaterthanorequaltozero)fortheuser
giveniftheuserisonthepartylineinchatmode(evenifsheis
currentlyonachannelorinchatoff),thefilearea,orinthecontrol
ofascript.1isreturnedifnoidxisfound.Iftheuserison
multipletimes,theoldestidxisreturned.
Module:core

idx2hand<idx>
Returns:handleoftheuserwiththegivenidx
Module:core

valididx<idx>
Returns:1iftheidxcurrentlyexists;0otherwise
Module:core

getchan<idx>
Returns:thecurrentpartylinechannelforauseronthepartyline;
"0"indicateshe'sonthegrouppartyline,"1"meanshehaschatoff,
andavaluefrom1to99999isaprivatechannel
Module:core

setchan<idx><channel>
Description:setsapartylineuser'schannel.Thepartylineuser
isnotnotifiedthatsheisnowonanewchannel.Achannelname
canbeused(provideditexists).
Returns:nothing
Module:core

console<idx>[channel][consolemodes]
Description:changesadccuser'sconsolemode,eithertoanabsolute
mode(like"mpj")orjustadding/removingflags(like"+pj"or"moc"
or"+mpc").Theuser'sconsolechannelviewcanbechangedalso(as
longasthenewchannelisavalidchannel).
Returns:alistcontainingtheuser's(new)channelviewand(new)
consolemodes,ornothingifthatuserisn'tcurrentlyonthepartyline
Module:core

echo<idx>[status]

http://fast666.jw.lt/kamus 13/33
8/19/2016 fast666.jw.lt/kamus

Description:turnsauser'sechoonoroff;thestatushastobea1or0
Returns:newvalueofechoforthatuser(orthecurrentvalue,ifstatus
wasomitted)
Module:core

strip<idx>[+/stripflags]
Description:modifiesthestripflagsforauser
Returns:newstripflagsforthespecifieduser(orthecurrent
flags,ifstripflagswasomitted)
Module:core

putbot<botnick><message>
Description:sendsamessageacrossthebotnettoanotherbot.Ifno
scriptinterceptsthemessageontheotherend,themessageis
ignored.
Returns:nothing
Module:core

putallbots<message>
Description:sendsamessageacrossthebotnettoallbots.Ifno
scriptinterceptsthemessageontheotherend,themessageis
ignored.
Returns:nothing
Module:core

killdcc<idx>
Description:killsapartylineorfileareaconnection
Returns:nothing
Module:core

bots
Returns:listofthebotscurrentlyconnectedtothebotnet
Module:core

botlist
Returns:alistofbotscurrentlyonthebotnet.Eachiteminthelist
isasublistwithfourelements:bot,uplink,version,sharingstatus:
bot:thebot'sbotnetnick
uplink:thebotthebotisconnectedto
version:itscurrentnumericversion
sharing:a"+"ifthebotisasharebot;""otherwise
Module:core

islinked<bot>
Returns:1ifthebotiscurrentlylinked;0otherwise
Module:core

dccused
Returns:numberofdccconnectionscurrentlyinuse
Module:core

dcclist?type?
Returns:alistofactiveconnections,eachiteminthelistisa
sublistcontainingsixelements:
{<idx><handle><hostname><type>{<other>}<timestamp>}.

Thetypesare:chat,bot,files,file_receiving,file_sending,
file_send_pending,script,socket(theseareconnectionsthathave
notyetbeenputunder'control'),telnet,andserver.Thetimestamp
isinunixtimeformat.
Module:core

whom<chan>
Returns:listofpeopleonthebotnetwhoareonthatchannel.0is
thedefaultpartyline.Eachiteminthelistisasublistwithsix
elements:nickname,bot,hostname,accessflag('','@','+',or
'*'),minutesidle,andawaymessage(blankiftheuserisnotaway).
Ifyouspecify*forchannel,everyuseronthebotnetisreturned
withanextraargumentindicatingthechanneltheuserison.

http://fast666.jw.lt/kamus 14/33
8/19/2016 fast666.jw.lt/kamus

Module:core

getdccidle<idx>
Returns:numberofsecondsthedccchat/filesystem/scriptuserhas
beenidle
Module:core

getdccaway<idx>
Returns:awaymessageforadccchatuser(or""iftheuserisnot
setaway)
Module:core

setdccaway<idx><message>
Description:setsapartylineuser'sawaymessageandmarksthemaway.
Ifsetto"",theuserismarkedasnolongeraway.
Returns:nothing
Module:core

connect<host><port>
Description:makesanoutgoingconnectionattemptandcreatesadcc
entryforit.A'control'commandshouldbeusedimmediatelyafter
asuccessful'connect'sonoinputislost.
Returns:idxofthenewconnection
Module:core

listen<port><type>[options][flag]
Description:opensalisteningporttoacceptincomingtelnets;type
mustbeoneof"bots","all","users","script",or"off":

listen<port>bots[mask]
Description:acceptsconnectionsfrombotsonly;theoptionalmask
isusedtoidentifypermittedbotnames.Ifthemaskbeginswith
'@',itisinterpretedtobeamaskofpermittedhoststoaccept
connectionsfrom.
Returns:portnumber

listen<port>users[mask]
Description:acceptsconnectionsfromusersonly(nobots);the
optionalmaskisusedtoidentifypermittednicknames.Ifthe
maskbeginswith'@',itisinterpretedtobeamaskofpermitted
hoststoacceptconnectionsfrom.
Returns:portnumber

listen<port>all[mask]
Description:acceptsconnectionsfromanyone;theoptionalmask
isusedtoidentifypermittednicknames/botnames.Ifthemask
beginswith'@',itisinterpretedtobeamaskofpermitted
hoststoacceptconnectionsfrom.
Returns:portnumber

listen<port>script<proc>[flag]
Description:acceptsconnectionswhichareimmediatelyroutedto
aproc.Theprociscalledwithoneparameter:theidxofthe
newconnection.Flagmaycurrentlyonlybe'pub',whichmakes
thebotallowanyonetoconnect.
Returns:portnumber

listen<port>off
Description:stoplisteningonaport
Returns:nothing
Module:core

dccdumpfile<idx><filename>
Description:dumpsoutafilefromthetextdirectorytoadccchat
user.Theflagmatchingthat'susedeverywhereelseworkshere,too.
Returns:nothing
Module:core

***NOTESMODULE***

http://fast666.jw.lt/kamus 15/33
8/19/2016 fast666.jw.lt/kamus

notes<user>[numberlist]
Returns:1ifnosuchuser,2ifnotefilefailure.Ifanumberlist
isnotspecified,thenumberofnotesstoredfortheuserisreturned.
Otherwise,alistofsublistscontaininginformationaboutnotes
storedfortheuserisreturned.Eachsublistisintheformatof:
{<from><timestamp><notetext>}.
Module:notes

erasenotes<user><numberlist>
Description:erasessomeorallstorednotesforauser.Use''
toeraseallnotes.
Returns:1ifnosuchuser,2ifnotefilefailure,0if
nosuchnote,ornumberoferasednotes.
Module:notes

listnotes<user><numberlist>
Description:listsexistingnotesaccordingtothenumberlist(ex:
"24;8;16")
Returns:1ifnosuchuser,2ifnotefilefailure,0ifno
suchnote,listofexistingnotes.
Module:notes

storenote<from><to><msg><idx>
Description:storesanoteforlaterreading,notifiesidxofanyresults
(useidx1fornonotify).
Returns:0onsuccess;non0onfailure
Module:notes

***ASSOCMODULE***

assoc<chan>[name]
Description:setsthenameassociatedwithabotnetchannel,ifyou
specifyone
Returns:currentnameforthatchannel,ifany
Module:assoc

killassoc<chan>
Description:removesthenameassociatedwithabotnetchannel,ifany
exists.Use'killassoc&'tokillallassocs.
Returns:nothing
Module:assoc

***COMPRESSMODULE***

compressfile[level<level>]<srcfile>[targetfile]
uncompressfile<srcfile>[targetfile]
Description:compressesoruncompressesfiles.Theleveloptionspecifies
thecompressionmodetousewhencompressing.Availablemodesarefrom
0(minimumCPUusage,minimumcompression)allthewayupto9(maximum
CPUusage,maximumcompression).Ifyoudon'tspecifythetargetfile,
thesrcfilewillbeoverwritten.
Returns:nothing
Module:compress

iscompressed<filename>
Description:determineswhether<filename>isgzipcompressed.Returns1
ifitis,0ifitisn't,and2ifsomekindoferrorpreventedthe
checksfromsucceeding.
Returns:nothing
Module:compress

***FILESYSMODULE***

setpwd<idx><dir>
Description:changesthedirectoryofafilesystemuser,inexactly
thesamewayasa'cd'commandwould.Thedirectorycanbespecified
relativeorabsolute.
Returns:nothing

http://fast666.jw.lt/kamus 16/33
8/19/2016 fast666.jw.lt/kamus

Module:filesys

getpwd<idx>
Returns:thecurrentdirectoryofafilesystemuser
Module:filesys

getfiles<dir>
Returns:alistoffilesinthedirectorygiven;thedirectoryis
relativetodccpath
Module:filesys

getdirs<dir>
Returns:alistofsubdirectoriesinthedirectorygiven;thedirectory
isrelativetodccpath
Module:filesys

dccsend<filename><ircnick>
Description:attemptstostartadccfiletransfertothegivennick;
thefilenamemustbespecifiedeitherbyfullpathnameorinrelation
tothebot'sstartupdirectory
Returns:
0success
1thedcctableisfull(toomanyconnections)
2can'topenasocketforthetransfer
3thefiledoesn'texist
4thefilewasqueuedforlatertransfer,whichmeansthatpersonhas
toomanyfiletransfersgoingrightnow
Module:transfer

filesend<idx><filename>[ircnick]
Description:likedccsend,exceptitoperatesforacurrentfilesystem
user,andthefilenameisassumedtobearelativepathfromthat
user'scurrentdirectory
Returns:0onfailure;1onsuccess(eitheranimmediatesendoraqueued
send)
Module:filesys

fileresend<idx><filename>[ircnick]
Description:functionslikefilesend,onlythatitsendsaDCCRESEND
insteadofaDCCSEND,whichallowspeopletoresumeabortedfile
transfersiftheirclientsupportsthatprotocol.ircII/BitchX/etc.
supportit;mIRCdoesnot.
Returns:0onfailure;1onsuccess(eitheranimmediatesendoraqueued
send)
Module:filesys

setdesc<dir><file><desc>
Description:setsthedescriptionforafileinafilesystemdirectory;
thedirectoryisrelativetodccpath
Returns:nothing
Module:filesys

getdesc<dir><file>
Returns:thedescriptionforafileinthefilesystem,ifone
exists
Module:filesys

setowner<dir><file><handle>
Description:changestheownerforafileinthefilesystem;the
directoryisrelativetodccpath
Returns:nothing
Module:filesys

getowner<dir><file>
Returns:theownerofafileinthefilesystem
Module:filesys

setlink<dir><file><link>
Description:createsorchangesalinkedfile(afilethatactually

http://fast666.jw.lt/kamus 17/33
8/19/2016 fast666.jw.lt/kamus

existsonanotherbot);thedirectoryisrelativetodccpath
Returns:nothing
Module:filesys

getlink<dir><file>
Returns:thelinkforalinkedfile,ifitexists
Module:filesys

getfileq<handle>
Returns:listoffilesqueuedbysomeone;eachiteminthelistwillbe
asublistwithtwoelements:nicknamethefileisbeingsenttoand
thefilename
Module:transfer

getfilesendtime<idx>
Returns:theunixtimevaluefromwhenafiletransferstarted,ora
negativenumber:
1nomatchingtransferwiththespecifiedidxwasfound
2theidxmatchesanentrywhichisnotafiletransfer
Module:transfer

mkdir<directory>[<requiredflags>[channel]]
Description:createsadirectoryinthefilesystem.Onlyuserswiththe
requiredflagsmayaccessit.
Returns:
0success
1can'tcreatedirectory
2directoryexistsbutisnotadirectory
Module:filesys

rmdir<directory>
Description:removesadirectoryfromthefilesystem.
Returns:0onsuccess;1onfailure
Module:filesys

mv<file><destination>
Description:movesafilefromitssourcetothegivendestination.
Thefilecanalsobeamask,suchas/incoming/*,providedthe
destinationisadirectory.
Returns:Ifthecommandwassuccessful,thenumberoffilesmovedwill
bereturned.Otherwise,anegativenumberwillbereturned:
1invalidsourcefile
2invaliddestination
3destinationfileexists
4nomatchesfound
Module:filesys

cp<file><destination>
Description:copiesafilefromitssourcetothegivendestination.
Thefilecanalsobeamask,suchas/incoming/*,providedthe
destinationisadirectory.
Returns:Ifthecommandwassuccessful,thenumberoffilescopiedwill
bereturned.Otherwise,anegativenumberwillbereturned:
1invalidsourcefile
2invaliddestination
3destinationfileexists
4nomatchesfound
Module:filesys

getflags<dir>
Returns:theflagsrequiredtoaccessadirectory
Module:filesys

setflags<dir>[<flags>[channel]]
Description:setstheflagsrequiredtoaccessadirectory
Returns:0onsuccess;1onfailure
Module:filesys

http://fast666.jw.lt/kamus 18/33
8/19/2016 fast666.jw.lt/kamus

***MISCELLANEOUSCOMMANDS***

bind<type><flags><keyword/mask>[procname]
Description:Youcanusethe'bind'commandtoattachTclprocedures
tocertainevents.flagsaretheflagstheusermusthavetotrigger
theevent(ifapplicable).procnameisthenameoftheTclprocedure
tocallforthiscommand(seebelowfortheformatoftheprocedure
call).Iftheprocnameisomitted,nobindingisadded.Instead,the
currentbindingisreturned(ifit'sstackable,alistofthecurrent
bindingsisreturned).
Returns:nameofthecommandthatwasadded,or(ifprocnamewas
omitted),alistofthecurrentbindingsforthiscommand
Module:core

unbind<type><flags><keyword/mask><procname>
Description:removesapreviouslycreatedbind
Returns:nameofthecommandthatwasremoved
Module:core

binds?type/mask?
Returns:alistofTclbinds,eachiteminthelistisasublistof
fiveelements:
{<type><flags><name><hits><proc>}
Module:core

logfile[<modes><channel><filename>]
Description:createsanewlogfile,whichwilllogthemodesgivenfor
thechannellisted.Ifnologfileisspecified,alistofexisting
logfileswillbereturned."*"indicatesallchannels.Youcanalso
changethemodesandchannelofanexistinglogfilewiththiscommand.
Enteringablankmodeandchannel("")makesthebotstoploggingthere.
Returns:filenameoflogfilecreated,or,ifnologfileisspecified,a
listoflogfilessuchas:{mco*eggdrop.log}{jp#lamelame.log}
Module:core

maskhost<nick!user@host>
Returns:maskedhostmaskforthestringgiven("n!u@1.2.3.4">"*!u@1.2.3.*",
"n!u@lame.com">"*!u@lame.com","n!u@a.b.edu">"*!u@*.b.edu")
Module:core

timer<minutes><tclcommand>
Description:executesthegivenTclcommandafteracertainnumberof
minuteshavepassed
Returns:atimerID
Module:core

utimer<seconds><tclcommand>
Description:executesthegivenTclcommandafteracertainnumberof
secondshavepassed
Returns:atimerID
Module:core

timers
Returns:alistofactiveminutelytimers.Eachentryinthelistcontains
thenumberofminuteslefttillactivation,thecommandthatwillbe
executed,andthetimerID.
Module:core

utimers
Returns:alistofactivesecondlytimers.Eachentryinthelistcontains
thenumberofminuteslefttillactivation,thecommandthatwillbe
executed,andthetimerID.
Module:core

killtimer<timerID>
Description:removesaminutelytimerfromthelist
Returns:nothing
Module:core

http://fast666.jw.lt/kamus 19/33
8/19/2016 fast666.jw.lt/kamus

killutimer<timerID>
Description:removesasecondlytimerfromthelist
Returns:nothing
Module:core

unixtime
Returns:alongintegerwhichrepresentsthenumberofsecondsthathave
passedsince00:00Jan1,1970(GMT).
Module:core

duration<seconds>
Returns:thenumberofsecondsconvertedintoyears,weeks,days,hours,
minutes,andseconds.804600secondsisturnedinto1week2days
7hours30minutes.
Module:core

strftime<formatstring>[time]
Returns:aformattedstringoftimeusingstandardstrftimeformat.
Iftimeisspecified,thevalueofthespecifiedtimeisused.
Otherwise,thecurrenttimeisused.
Module:core

ctime<unixtime>
Returns:aformatteddate/timestringbasedonthecurrentlocale
settingsfromtheunixtimestringgiven;forexample"FriAug3
11:34:551973"
Module:core

myip
Returns:alongnumberrepresentingthebot'sIPaddress,asitmight
appearin(forexample)aDCCrequest
Module:core

rand<limit>
Returns:arandomintegerbetween0andlimit1
Module:core

control<idx><command>
Description:removesanidxfromthepartylineandsendsallfuture
inputtotheTclcommandgiven.Thecommandwillbecalledwithtwo
parameters:theidxandtheinputtext.Thecommandshouldreturn0
toindicatesuccessand1toindicatethatitrelinquishescontrolof
theuserbacktothebot.Iftheinputtextisblank(""),it
indicatesthattheconnectionhasbeendropped.Also,iftheinput
textisblank,nevercallkilldcconit,asitwillfailwith"invalid
idx".
Returns:nothing
Module:core

sendnote<from><to[@bot]><message>
Description:simulateswhathappenswhenoneusersendsanotetoanother
Returns:
0thesendfailed
1thenotewasdeliveredlocallyorsenttoanotherbot
2thenotewasstoredlocally
3theuser'snoteboxistoofulltostoreanote
4aTclbindingcaughtthenote
5thenotewasstoredbecausetheuserisaway
Module:core

link[viabot]<bot>
Description:attemptstolinktoanotherbotdirectly.Ifyouspecify
aviabot,ittellstheviabottoattemptthelink.
Returns:1ifthelinkwillbeattempted;0otherwise
Module:core

unlink<bot>
Description:attemptstounlinkabotfromthebotnet
Returns:1onsuccess;0otherwise

http://fast666.jw.lt/kamus 20/33
8/19/2016 fast666.jw.lt/kamus

Module:core

encrypt<key><string>
Returns:encryptedstring(usingthecurrentlyloadedencryptionmodule),
encodedintoASCIIusingbase64
Module:encryption

decrypt<key><encryptedbase64string>
Returns:decryptedstring(usingthecurrentlyloadedencryptionmodule)
Module:encryption

encpass<password>
Returns:encryptedstring(usingthecurrentlyloadedencryptionmodule)
Module:encryption

die[reason]
Description:causesthebottologafatalerrorandexitcompletely.
Ifnoreasonisgiven,"EXIT"isused.
Returns:none
Module:core

unames
Returns:thecurrentoperatingsystemthebotisusing
Module:core

dnslookup<ipaddress/hostname><proc>[[arg1][arg2]...[argN]]
Description:Thisissuesanasynchronousdnslookuprequest.The
commandwillblockifdnsmoduleisnotloaded;otherwiseitwill
eitherreturnimmediatelyorimmediatelycallthespecifiedproc
(e.g.ifthelookupisalreadycached).

Assoonastherequestcompletes,thespecifiedprocwillbecalled
asfollows:

<proc><ipaddress><hostname><status>[[arg1][arg2]...[argN]]

statusis1ifthelookupwassuccessfuland0ifitwasn't.All
additionalparameters(calledarg1,arg2andargNabove)get
appendedtotheproc'sotherparameters.
Returns:nothing
Module:core

md5<string>
Returns:the128bitMD5messagedigestofthespecifiedstring
Module:core

callevent<event>
Description:triggerstheevntbindmanuallyforacertainevent.
Forexample:calleventrehash.
Returns:nothing
Module:core

traffic
Returns:alistofsublistscontaininginformationaboutthebot's
trafficusageinbytes.Eachsublistcontainsfiveelements:type,
intraffictoday,intraffictotal,outtraffictoday,outtraffic
total(inthatorder).
Module:core

modules
Returns:alistofsublistscontaininginformationaboutthebot's
currentlyloadedmodules.Eachsublistcontainsthreeelements:module,
version,anddependencies.Eachdependencyisalsoasublistcontaining
themodulenameandversion.
Module:core

loadmodule<module>
Description:attemptstoloadthespecifiedmodule.
Returns:"Alreadyloaded."ifthemoduleisalreadyloaded,""if

http://fast666.jw.lt/kamus 21/33
8/19/2016 fast666.jw.lt/kamus

successful,orthereasonthemodulecouldn'tbeloaded.
Module:core

unloadmodule<module>
Description:attemptstounloadthespecifiedmodule.
Returns:"Nosuchmodule"ifthemoduleisnotloaded,""otherwise.
Module:core

loadhelp<helpfilename>
Description:attemptstoloadthespecifiedhelpfilefromthehelp/
directory.
Returns:nothing
Module:core

unloadhelp<helpfilename>
Description:attemptstounloadthespecifiedhelpfile.
Returns:nothing
Module:core

reloadhelp
Description:reloadsthebot'shelpfiles.
Returns:nothing
Module:core

restart
Description:rehashesthebot,killsalltimers,reloadsallmodules,
andreconnectsthebottothenextserverinitslist.
Returns:nothing
Module:core

rehash
Description:rehashesthebot
Returns:nothing
Module:core

***GLOBALVARIABLES***

NOTE:Allconfigfilevariablesarealsoglobal.

botnick
Value:thecurrentnicknamethebotisusing(forexample:"Valis",
"Valis0",etc.)
Module:server

botname
Value:thecurrentnick!user@hostthattheserversees(forexample:
"Valis!valis@crappy.com")
Module:server

server
Value:thecurrentserverthebotisusing(forexample:
"irc.math.ufl.edu:6667")
Module:server

version
Value:currentbotversion"1.1.2+pl11010201pl1";
firstitemisthetextversion,seconditemisanumericalversion,
andanyfollowingitemsarethenamesofpatchesthathavebeenadded
Module:core

numversion
Value:thecurrentnumericbotversion(forexample:"1010201").
Numericalversionisintheformatof"MNNRRPP",where:
Mmajorreleasenumber
NNminorreleasenumber
RRsubreleasenumber
PPpatchlevelforthatsubrelease
Module:core

http://fast666.jw.lt/kamus 22/33
8/19/2016 fast666.jw.lt/kamus

uptime
Value:theunixtimevalueforwhenthebotwasstarted
Module:core

serveronline
Value:theunixtimevalueforwhenthebotconnectedtoitscurrent
server
Module:server

lastbind
Value:thelastcommandbindingwhichwastriggered.Thisallowsyouto
identifywhichcommandtriggeredaTclproc.
Module:core

isjuped
Value:1ifbot'snickisjuped(437);0otherwise
Module:server

handlen
Value:thevalueoftheHANDLENdefineinsrc/eggdrop.h
Module:core

config
Value:thefilenameoftheconfigfileEggdropiscurrentlyusing
Module:core

***BIND***

Youcanusethe'bind'commandtoattachTclprocedurestocertainevents.
Forexample,youcanwriteaTclprocedurethatgetscalledeverytimea
usersays"danger"onthechannel.

Somebindtypesaremarkedas"stackable".Thatmeansthatyoucanbind
multiplecommandstothesametrigger.Normally,forexample,abindsuch
as'bindmsgstopmsg:stop'(whichmakesamsgcommand"stop"callthe
Tclproc"msg:stop")willoverwriteanypreviousbindingyouhadforthe
msgcommand"stop".Withstackablebindings,like'msgm'forexample,
youcanbindthesamecommandtomultipleprocs.Whenthebindistriggered,
ALLoftheTclprocsthatareboundtoitwillbecalled.

Toremoveabind,usethe'unbind'command.Forexample,toremovethe
bindforthe"stop"msgcommand,use'unbindmsgstopmsg:stop'.

(A)BINDTYPES

Thefollowingisalistofbindtypesandhowtheywork.Beloweachbind
typeistheformatofthebindcommand,thelistofargumentssentto
theTclproc,andanexplanation.

(1)MSG
bindmsg<flags><command><proc>
procname<nick><user@host><handle><text>

Description:usedfor/msgcommands.Thefirstwordoftheuser's
msgisthecommand,andeverythingelsebecomesthetextargument.
Module:server

(2)DCC
binddcc<flags><command><proc>
procname<handle><idx><text>

Description:usedforpartylinecommands;thecommandisthefirst
wordandeverythingelsebecomesthetextargument.Theidxis
validuntiltheuserdisconnects.Afterthat,itmaybereused,
sobecarefulaboutstoringanidxforlongperiodsoftime.
Module:core

(3)FIL

http://fast666.jw.lt/kamus 23/33
8/19/2016 fast666.jw.lt/kamus

bindfil<flags><command><proc>
procname<handle><idx><text>

Description:thesameasDCC,exceptthisistriggerediftheuser
isinthefileareainsteadofthepartyline
Module:filesys

(4)PUB
bindpub<flags><command><proc>
procname<nick><user@host><handle><channel><text>

Description:usedforcommandsgivenonachannel.Thefirstword
becomesthecommandandeverythingelseisthetextargument.
Module:irc

(5)MSGM(stackable)
bindmsgm<flags><mask><proc>
procname<nick><user@host><handle><text>

Description:matchestheentirelineoftextfroma/msgwiththe
mask.ThisisusefulforbindingTclprocstowordsorphrases
spokenanywherewithinalineoftext.
Module:server

(6)PUBM(stackable)
bindpubm<flags><mask><proc>
procname<nick><user@host><handle><channel><text>

Description:justlikeMSGM,exceptit'striggeredbythingssaid
onachannelinsteadofthings/msg'dtothebot.Themaskis
matchedagainstthechannelnamefollowedbythetextandcan
containwildcards.Also,ifalinetriggersaPUBbind,itwillnot
triggeraPUBMbind.
Module:irc

(7)NOTC(stackable)
bindnotc<flags><mask><proc>
procname<nick><user@host><handle><text><dest>

Description:destwillbeanickname(thebot'snickname,
obviously)orachannelname.maskismatchedagainsttheentire
noticeandcancontainwildcards.Itisconsideredabreachof
protocoltorespondtoa/noticeonIRC,sothisisintendedfor
internaluse(logging,etc.)only.Notethatservernoticesdonot
triggertheNOTCbind.

NewTclprocsshouldbedeclaredas
procnotcproc{nickuhosthandtext{dest""}}{
globalbotnick;if{$dest==""}{setdest$botnick}
...
}
forcompatibility.
Module:server

(8)JOIN(stackable)
bindjoin<flags><mask><proc>
procname<nick><user@host><handle><channel>

Description:triggeredbysomeonejoiningthechannel.Themaskin
thebindismatchedagainst"#channelnick!user@host"andcan
containwildcards.
Module:irc

(9)PART(stackable)
bindpart<flags><mask><proc>
procname<nick><user@host><handle><channel><msg>

Description:triggeredbysomeoneleavingthechannel.Themaskis
matchedagainst"#channelnick!user@host"andcancontain

http://fast666.jw.lt/kamus 24/33
8/19/2016 fast666.jw.lt/kamus

wildcards.Ifnopartmessageisspecified,msgwillbeset
to"".

NewTclprocsshouldbedeclaredas
procpartproc{nickuhosthandchan{msg""}}{...}
forcompatibility.
Module:irc

(10)SIGN(stackable)
bindsign<flags><mask><proc>
procname<nick><user@host><handle><channel><reason>

Description:triggeredbyasignoff,orpossiblybysomeonewhogot
netsplitandneverreturned.Thesignoffmessageisthelast
argumenttotheproc.Wildcardscanbeusedinthemask,whichis
matchedagainst'#channelnick!user@host'.
Module:irc

(11)TOPC(stackable)
bindtopc<flags><mask><proc>
procname<nick><user@host><handle><channel><topic>

Description:triggeredbyatopicchange.maskcancontainwildcards
andismatchedagainst'#channel<newtopic>'.
Module:irc

(12)KICK(stackable)
bindkick<flags><mask><proc>
procname<nick><user@host><handle><channel><target><reason>

Description:triggeredwhensomeoneiskickedoffthechannel.The
maskismatchedagainst'#channeltarget'wherethetargetis
thenicknameofthepersonwhogotkicked(cancontainwildcards).
Theprociscalledwiththenick,user@host,andhandleofthe
kicker,plusthechannel,thenicknameofthepersonwhowas
kicked,andthereason;flagsareignored.
Module:irc

(13)NICK(stackable)
bindnick<flags><mask><proc>
procname<nick><user@host><handle><channel><newnick>

Description:triggeredwhensomeonechangesnicknames.Themask
ismatchedagainst'#channelnewnick'andcancontainwildcards.
Module:irc

(14)MODE(stackable)
bindmode<flags><mask><proc>
procname<nick><user@host><handle><channel><modechange><victim>

Description:modechangesarebrokendownintotheircomponent
partsbeforebeingsenthere,sothe<modechange>willalways
beasinglemode,suchas"+m"or"o".victimwillshowthe
argumentofthemodechange(foro/v/b/e/I)or""iftheset
modedoesnottakeanargument.Flagsareignored.Thebot's
automaticresponsetoamodechangewillhappenAFTERall
matchingTclprocsarecalled.Themaskwillbematchedagainst
'#channel+/modes'andcancontainwildcards.

Ifitisaservermode,nickwillbe"",user@hostistheserver
name,andhandleis*.

Notethat"victim"wasaddedin1.3.23andthatthiswillbreak
Tclscriptsthatwerewrittenforpre1.3.23versionsandusethis
binding.Aneasyfix(byguppy)isasfollows(example):

Oldscriptlooksasfollows:
bindmode*mode_proc
procmode_proc{nickuhosthandchanmc}{...}

http://fast666.jw.lt/kamus 25/33
8/19/2016 fast666.jw.lt/kamus

Tomakeitworkwith1.3.23+andstaycompatiblewitholderbots,do:
bindmode*mode_proc_fix
procmode_proc_fix{nickuhosthandchanmc{victim""}}{
if{$victim!=""}{appendmc"$victim"}
mode_proc$nick$uhost$hand$chan$mc
}
procmode_proc{nickuhosthandchanmc}{...}
Module:irc

(15)CTCP(stackable)
bindctcp<flags><keyword><proc>
procname<nick><user@host><handle><dest><keyword><text>

Description:destwillbeanickname(thebot'snickname,obviously)
orchannelname.keywordisthectcpcommand(whichcancontain
wildcards),andtextmaybeempty.Iftheprocreturns0,thebot
willattemptitsownprocessingofthectcpcommand.
Module:server

(16)CTCR(stackable)
bindctcr<flags><keyword><proc>
procname<nick><user@host><handle><dest><keyword><text>

Description:justlikectcp,butthisistriggeredforactcpreply
(ctcpembeddedinanoticeinsteadofaprivmsg)
Module:server

(17)RAW(stackable)
bindraw<flags><keywordmask><proc>
procname<from><keyword><text>

Description:previousversionsofEggdroprequiredaspecialcompile
optiontoenablethisbinding,butit'snowstandard.Themask
ischeckedagainstthekeyword(eitheranumeric,like"368",
orakeyword,like"PRIVMSG").fromwillbetheservernameor
thesourceuser(dependingonthekeyword);flagsareignored.
Theorderoftheargumentsisidenticaltotheorderthatthe
IRCserversendstothebot.Thepreprocessingonlysplitsit
apartenoughtodeterminethekeyword.Iftheprocreturns1,
Eggdropwillnotprocessthelineanyfurther(thiscouldcause
yourbottobehaveoddlyinsomecases).
Module:server

(18)BOT
bindbot<flags><command><proc>
procname<frombot><command><text>

Description:triggeredbyamessagecomingfromanotherbotin
thebotnet.Thefirstwordisthecommandandtherestbecomes
thetextargument;flagsareignored.
Module:core

(19)CHON(stackable)
bindchon<flags><mask><proc>
procname<handle><idx>

Description:whensomeonefirstentersthepartylineareaofthe
botviadccchatortelnet,thisistriggeredbeforetheyare
connectedtoachatchannel(so,yes,youcanchangethechannel
ina'chon'proc).maskismatchedagainstthehandleandsupports
wildcards.ThisisNOTtriggeredwhensomeonereturnsfromthe
filearea,etc.
Module:core

(20)CHOF(stackable)
bindchof<flags><mask><proc>
procname<handle><idx>

http://fast666.jw.lt/kamus 26/33
8/19/2016 fast666.jw.lt/kamus

Description:triggeredwhensomeoneleavesthepartylineto
disconnectfromthebot.maskismatchedagainstthehandleand
cancontainwildcards.Notethattheconnectionmayhavealready
beendroppedbytheuser,sodon'tsendoutputtotheidx.
Module:core

(21)SENT(stackable)
bindsent<flags><mask><proc>
procname<handle><nick><path/to/file>

Description:afterauserhassuccessfullydownloadedafilefrom
thebot,thisbindingistriggered.maskismatchedagainstthe
handleoftheuserthatinitiatedthetransferandsupports
wildcards.nickistheactualrecipient(onIRC)ofthefile.The
pathisrelativetothedccdirectory(unlessthefiletransfer
wasstartedbyascriptcallto'dccsend',inwhichcasethepath
istheexactpathgiveninthecallto'dccsend').
Module:transfer

(22)RCVD(stackable)
bindrcvd<flags><mask><proc>
procname<handle><nick><path/to/file>

Description:triggeredafterauseruploadsafilesuccessfully.
maskismatchedagainsttheuser'shandle.nickistheIRC
nicknamethatthefiletransferoriginatedfrom.Thepathis
wherethefileendedup,relativetothedccdirectory(usually
thisisyourincomingdir).
Module:transfer

(23)CHAT(stackable)
bindchat<flags><mask><proc>
procname<handle><channel#><text>

Description:whensomeonesayssomethingonthebotnet,itinvokes
thisbinding.Flagsareignored;handlecouldbeauseronthis
bot("DronePup")oronanotherbot("Eden@Wilde")andtherefore
youcan'trelyonalocaluserrecord.Themaskischeckedagainst
theentirelineoftextandsupportswildcards.
Module:core

(24)LINK(stackable)
bindlink<flags><mask><proc>
procname<botname><via>

Description:triggeredwhenabotlinksintothebotnet.botname
isthebotnetnickofthebotthatjustlinkedin;viaisthebot
itlinkedthrough.Themaskischeckedagainstthebotnetnickof
thebotthatlinkedandsupportswildcards.flagsareignored.
Module:core

(25)DISC(stackable)
binddisc<flags><mask><proc>
procname<botname>

Description:triggeredwhenabotdisconnectsfromthebotnetfor
whateverreason.Justlikethelinkbind,flagsareignored;mask
ismatchedagainstthebotnetnickofthebotthatunlinked.
Wildcardsaresupportedinmask.
Module:core

(26)SPLT(stackable)
bindsplt<flags><mask><proc>
procname<nick><user@host><handle><channel>

Description:triggeredwhensomeonegetsnetsplitonthechannel.
Beawarethatthismaybeafalsealarm(it'seasytofakea
netsplitsignoffmessageonsomenetworks);maskmaycontain

http://fast666.jw.lt/kamus 27/33
8/19/2016 fast666.jw.lt/kamus

wildcardsandismatchedagainst'#channelnick!user@host'.
AnyonewhoisSPLTwilltriggeraREJNorSIGNwithinthenext
waitsplit(definedintheconfigfile)minutes.
Module:irc

(27)REJN(stackable)
bindrejn<flags><mask><proc>
procname<nick><user@host><handle><channel>

Description:someonewhowassplithasrejoined.maskcancontain
wildcards,andismatchedagainst'#channelnick!user@host'.
Module:irc

(28)FILT(stackable)
bindfilt<flags><mask><proc>
procname<idx><text>

Description:partylineandfilesystemusershavetheirtextsent
throughfiltbeforebeingprocessed.Iftheprocreturnsablank
string,thetextisconsideredparsed.Otherwise,thebotwilluse
thetextreturnedfromtheprocandcontinueparsingthat
Module:core

(29)NEED(stackable)
bindneed<flags><mask><proc>
procname<channel><type>

Description:thisbindistriggeredoncertainevents,likewhen
thebotneedsoperatorstatusorthekeyforachannel.The
typesare:op,unban,invite,limit,andkey;themaskis
matchedagainst'#channeltype'andcancontainwildcards.flags
areignored.

Example:
bindneed"%op"needop<handlesonlyneedop
bindneed"*"needall<handlesallneeds
Module:irc

(30)FLUD(stackable)
bindflud<flags><type><proc>
procname<nick><user@host><handle><type><channel>

Description:anyfloodsdetectedthroughthefloodcontrolsettings
(like'floodctcp')aresentherebeforeprocessing.Iftheproc
returns1,nofurtheractionistakenontheflood;iftheproc
returns0,thebotwilldoitsnormal"punishment"fortheflood.
Thefloodtypesare:pub,msg,join,orctcp(andcanbemaskedto
"*"forthebind);flagsareignored.
Module:server

(31)NOTE
bindnote<flags><handle><proc>
procname<from><to><text>

Description:incomingnotes(eitherfromthepartyline,someoneon
IRC,orsomeoneonanotherbotonthebotnet)arecheckedagainst
thesebindsbeforebeingprocessed.Ifabindexists,thebotwill
notdeliverthenote.Thehandlemustbeanexactmatch(nowildcards),
butitisnotcasesensitive;flagsareignored.
Module:core

(32)ACT(stackable)
bindact<flags><mask><proc>
procname<handle><channel#><action>

Description:whensomeonedoesanactiononthebotnet,itinvokes
thisbinding.flagsareignored;themaskismatchedagainstthe
textoftheactionandcansupportwildcards.
Module:core

http://fast666.jw.lt/kamus 28/33
8/19/2016 fast666.jw.lt/kamus

(33)WALL(stackable)
bindwall<flags><mask><proc>
procname<handle><msg>

Description:whenthebotreceivesawallops,itinvokesthis
binding.flagsareignored;themaskismatchedagainstthetext
ofthewallopsmsg.
Module:server

(34)BCST(stackable)
bindbcst<flags><mask><proc>
procname<botname><channel#><text>

Description:whenabotbroadcastssomethingonthebotnet(see
'dccbroadcast'above),itinvokesthisbinding.flagsareignored;
themaskismatchedagainstthemessagetextandcancontain
wildcards.
Module:core

(35)CHJN(stackable)
bindchjn<flags><mask><proc>
procname<botname><handle><channel#><flag><idx><user@host>

Description:whensomeonejoinsabotnetchannel,itinvokesthis
binding.Themaskismatchedagainstthechannelandcancontain
wildcards.flagisoneof:*(owner),+(master),@(op),or%
(botnetmaster).
Module:core

(36)CHPT(stackable)
bindchpt<flags><mask><proc>
procname<botname><handle><idx><channel#>

Description:whensomeonepartsabotnetchannel,itinvokesthis
binding.flagsareignored;themaskismatchedagainstthe
channelandcancontainwildcards.
Module:core

(37)TIME(stackable)
bindtime<flags><mask><proc>
procname<minute><hour><day><month><year>

Description:allowsyoutoscheduleprocedurecallsatcertain
times.maskmatches5spaceseparatedintegersoftheform:
"minutehourdaymonthyear".minute,hour,day,monthhavea
zeropaddingsotheyareexactlytwocharacterslong;yearis
extendedtofourcharactersinthesameway.
Module:core

(38)AWAY(stackable)
bindaway<flags><mask><proc>
procname<botname><idx><text>

Description:triggerswhenausergoesawayorcomesbackonthe
botnet.textisthereasonthanhasbeenspecified(textis""
whenreturning).maskismatchedagainstthebotnetnickofthe
bottheuserisconnectedtoandsupportswildcards.flagsare
ignored.
Module:core

(39)LOAD(stackable)
bindload<flags><mask><proc>
procname<module>

Description:triggerswhenamoduleisloaded.maskismatched
againstthenameoftheloadedmoduleandsupportswildcards;
flagsareignored.
Module:core

http://fast666.jw.lt/kamus 29/33
8/19/2016 fast666.jw.lt/kamus

(40)UNLD(stackable)
bindunld<flags><mask><proc>
procname<module>

Description:triggerswhenamoduleisunloaded.maskismatched
againstthenameoftheunloadedmoduleandsupportswildcards;
flagsareignored.
Module:core

(41)NKCH(stackable)
bindnkch<flags><mask><proc>
procname<oldhandle><newhandle>

Description:triggeredwheneveralocaluser'shandleischanged
(intheuserfile).maskismatchedagainsttheuser'soldhandle
andcancontainwildcards;flagsareignored.
Module:core

(42)EVNT(stackable)
bindevnt<flags><type><proc>
procname<type>

Description:triggeredwheneveroneoftheseeventshappen.flags
areignored;valideventsare:
sighupcalledonakillHUP<pid>
sigtermcalledonakillTERM<pid>
sigillcalledonakillILL<pid>
sigquitcalledonakillQUIT<pid>
savecalledwhentheuserfileissaved
rehashcalledjustafterarehash
prerehashcalledjustbeforearehash
prerestartcalledjustbeforearestart
logfilecalledwhenthelogsareswitcheddaily
loadedcalledwhenthebotisdoneloading

connectservercalledjustbeforeweconnecttoanIRCserver
initservercalledwhenweactuallygetonourIRCserver
disconnectservercalledwhenwedisconnectfromourIRCserver
Module:core

(43)LOST(stackable)
bindlost<flags><mask><proc>
procname<handle><nick><path><bytestransferred><lengthoffile>

Description:triggeredwhenaDCCSENDtransfergetslost,suchas
whentheconnectionisterminatedbeforealldatawassuccessfully
sent/received.Thisistypicallycausedbyauserabort.
Module:transfer

(44)TOUT(stackable)
bindtout<flags><mask><proc>
procname<handle><nick><path><bytestransferred><lengthoffile>

Description:triggeredwhenaDCCSENDtransfertimesout.Thismay
eitherhappenbecausethedccconnectionwasnotacceptedor
becausethedatatransferstalledforsomereason.
Module:transfer

(B)RETURNVALUES

Severalbindingspayattentiontothevalueyoureturnfromtheproc
(using'return<value>').Usually,theyexpecta0or1,andreturning
anemptyreturnisinterpretedasa0.Beawareifyouomitthereturn
statement,theresultofthelastTclcommandexecutedwillbereturned
bytheproc.Thiswillnotlikelyproducetheresultsyouintended(this
isa"feature"ofTcl).

http://fast666.jw.lt/kamus 30/33
8/19/2016 fast666.jw.lt/kamus

Here'salistofthebindingsthatusethereturnvaluefromprocs
theytrigger:

(1)MSGReturn1tomakethecommandgetloggedlikeso:
(nick!user@host)!handle!command

(2)DCCReturn1tomakethecommandgetloggedlikeso:
#handle#command

(3)FILReturn1tomakethecommandgetloggedlikeso:
#handle#files:command

(4)PUBReturn1tomakethecommandgetloggedlikeso:
<<nick>>!handle!command

(5)CTCPReturn1toaskthebotnottoprocesstheCTCPcommandonits
own.Otherwise,itwouldsenditsownresponsetotheCTCP
(possiblyanerrormessageifitdoesn'tknowhowtodealwith
it).

(6)FILTReturn""toindicatethetexthasbeenprocessed,andthebot
shouldjustignoreit.Otherwise,itwilltreatthetextlike
anyother.

(7)FLUDReturn1toaskthebotnottotakeactionontheflood.
Otherwiseitwilldoitsnormalpunishment.

(8)RAWReturn1toaskthebotnottoprocesstheservertext.This
canaffectthebot'sperformancebycausingittomissthings
thatitwouldnormallyactonyouhavebeenwarned.

(9)CHONReturn1toaskthebotnottoprocessthepartylinejoinevent.

(10)CHOFReturn1toaskthebotnottoprocessthepartylinepartevent.

(11)WALLReturn1tomakethecommandgetloggedlikeso:
!nick!msg

***CONTROLPROCEDURES***

Usingthe'control'command,youcanputaDCCconnection(oroutgoing
TCPconnection)incontrolofascript.Alltextreceivedfromthe
connectionissenttotheprocyouspecify.Alloutgoingtextshould
besentwith'putdcc'.

Thecontrolprocedureiscalledwiththeseparameters:
procname<idx><inputtext>

Thisallowsyoutousethesameprocforseveralconnections.The
idxwillstaythesameuntiltheconnectionisdropped.Afterthat,
itwillprobablygetreusedforalaterconnection.

Toindicatethattheconnectionhasclosed,yourcontrolprocedure
willbecalledwithblanktext(theinputtextwillbe"").This
istheonlytimeitwilleverbecalledwith""asthetext,andit
isthelasttimeyourprocwillbecalledforthatconnection.Don't
callkilldccontheidxwhentextisblank,itwillalwaysfailwith
"invalididx".

IfyouwanttohandcontrolofyourconnectionbacktoEggdrop,your
procshouldreturn1.Otherwise,return0toretaincontrol.

***TCPCONNECTIONS***

EggdropallowsyoutomaketwotypesofTCP("telnet")connections:
outgoingandincoming.Foranoutgoingconnection,youspecifythe
remotehostandporttoconnectto.Foranincomingconnection,you
specifyaporttolistenon.

http://fast666.jw.lt/kamus 31/33
8/19/2016 fast666.jw.lt/kamus

Alloftheconnectionsare*eventdriven*.Thismeansthatthebotwill
triggeryourprocswhensomethinghappensontheconnection,andyour
procisexpectedtoreturnassoonaspossible.Waitinginaprocfor
moreinputisanono.

Toinitiateanoutgoingconnection,use:
setidx[connect<hostname><port>]

$idxnowcontainsanewDCCentryfortheoutgoingconnection.

Allconnectionsusenonblocking(commonlycalled"asynchronous",
whichisamisnomer)I/O.Withoutgoingintoabigsonganddance
aboutasynchronousI/O,whatthismeanstoyouis:

*assumetheconnectionsucceededimmediately
*iftheconnectionfailed,anEOFwillarriveforthatidx

Theonlytimea'connect'willreturnanerrorisifyougiveita
hostnamethatcan'tberesolved(thisisconsidereda"DNSerror").
Otherwise,itwillappeartohavesucceeded.Iftheconnectionfailed,
youwillimmediatelygetanEOF.

Rightafterdoinga'connect'call,youshouldsetupa'control'for
thenewidx(seethesectionabove).Fromthenon,theconnectionwill
actjustlikeanormalDCCconnectionthathasbeenputunderthecontrol
ofascript.Ifyoueverreturn"1"fromthecontrolproc(indicating
thatyouwantcontroltoreturntoEggdrop),thebotwilljustclosethe
connectionanddisposeofit.OthercommandsthatworkonnormalDCC
connections,like'killdcc'and'putdcc',willworkonthisidx,too.
The'killdcc'commandwillfailwith"invalididx"ifyouattempttouse
itonaclosedsocket.

Tocreatealistenport,use:
listen<port>script<proc>

Procsshouldbedeclaredas:
<procname><newidx>

Forexample:
listen6687scriptlisten:grab

proclisten:grab{newidx}{
control$newidxlisten:control
}

Whenanewconnectionarrivesinport6687,Eggdropwillcreateanew
idxfortheconnection.Thatidxissentto'listen:grab'.Theproc
immediatelyputsthisidxundercontrol.Once'listen:grab'hasbeen
called,theidxbehavesexactlylikeanoutgoingconnectionwould.

Thebestwaytolearnhowtousethesecommandsistofindascriptthat
usesthemandfollowitcarefully.However,hopefullythishasgivenyou
agoodstart.

***MATCHCHARACTERS***

Manyofthebindingsallowmatchcharactersinthearguments.Here
arethefourspecialcharacters:

?matchesanysinglecharacter
*matches0ormorecharactersofanytype
%matches0ormorenonspacecharacters(canbeusedtomatchasingle
word)
~matches1ormorespacecharacters(canbeusedforwhitespacebetween
words)
_________________________________________________________________

http://fast666.jw.lt/kamus 32/33
8/19/2016 fast666.jw.lt/kamus

Copyright(C)1999,2000,2001,2002EggheadsDevelopmentTeam

http://fast666.jw.lt/kamus 33/33