Jump to content
chain

kvirc to mIRC Avatars

Recommended Posts

  • Administrators

So.
Last night I decided to try out kvirc.
I'll be honest I don't like it.
Its too picturey I like basic text.

But out of all features, one feature really caught my eye.
"The AVATAR Idea"
The concept of users having avatars on IRC.

I really liked this idea, a friend on a chat server told be it used DCC.
I asked about how it worked and he werent to sure as he didn't use that feature.

So after playing around with mIRC and kvirc I found out how it works.

Its just CTCP's and DCC's 😄

So I spent till 5am coding this damn thing up after a lot of dead ends and troubleshooting I've sorted it.
So have fun,

Report any bugs you find.

NOTE:
Currently two mIRC clients don't properly swap avatars.
I intend to fix this soon!

Leave comments, bug reports and suggestions below.

I intend to setup a bug reporting system for my scripts!

Find me at irc.ilkotech.co.uk in #ilkotech if you want help with anything mIRC related!

 

;The AVATAR Idea.
;This nice feature is used in kvirc, and its nice.
;So why not let mIRC do the same?
;So thats what I intend to do with this script.
;Unluckily i've never used DCC in scripts so this will be a test.

;Script by Thomas Edwards (TMFKSOFT)
;Copyright Ilkotech.co.uk & Thomas Edwards 2011

;I plan for it to modify the address book :)

;Let the games begin.

menu nicklist {
  -
  Notify Avatar:/avatar_send $1
  View Avatar:/avatar_view $1
}
menu * {
  Set Avatar:/avatar_set
}
alias avatar_send {
  if (%avatar_name != $null) {
    ctcpreply $1 AVATAR $replace(%avatar_name,$chr(32),_) %avatar_size
  }
  else {
    echo 4You have not set an avatar. Set one via /avatar_set
  }
}
alias avatar_set {
  var %file $sfile($mircdir $+ avatars\,Select Avatar)
  set %avatar_size $file(%file).size
  set %avatar_name $right(%file,$calc(0 - $pos(%file,\,$count(%file,\))))
  set %avatar_path %file
  echo Avatar set!
}
alias avatar_view {

  if ($1 == $me) {

    if (%avatar_name != $null) {
      window -osCdbptw0 @Avatar 0 0 256 256
      drawpic -s @Avatar 0 0 256 256 %avatar_path
    }
    else {
      echo 4You have not set an avatar. Set one via /avatar_set
    }
  }
  else {
    if ($readini(avatars.ini,others,$1) != $null) {
      window -soCdbptw0 @Avatar 0 0 265 292
      drawpic -s @Avatar 0 0 256 256 avatars\ $+ $readini(avatars.ini,others,$1)
    }
  }
  else {
    echo -t [Avatar] $1 does not have an Avatar. Why not politely ask them for it?
  }
}
on *:CTCPREPLY:AVATAR*:{
  echo -t $active [Avatar] $nick changes their avatar to $qt($2)
  if ($exists(avatars\) == $FALSE) {
    mkdir avatars
  }
  if ($exists(avatars\ $+ $2) == $FALSE) {
    raw -q NOTICE $nick :DCC GET $2 $3 $+ 
    set %avatar_recv 1
  }
  echo Avatar exists. Updating user avatar.
  writeini avatars.ini others $nick $2
  HALTDEF
}

CTCP *:DCC:{
  if ($2 == GET) {
    echo Sending Avatar. File: $replace(%avatar_name,$chr(32),_) Size: %avatar_size User: $nick
    dcc SEND $nick %avatar_path
  }
}
on *:FILERCVD:*:{
  if (%avatar_recv == 1) {
    copy -o $file($filename).shortfn avatars\
    remove $file($filename).shortfn
    unset %avatar_recv
  }
}
on *:NICK:{
  if ($readini(avatars.ini,others,$nick) != $null) {
    writeini avatars.ini others $newnick $readini(avatars.ini,others,$nick)
    remini avatars.ini others $nick
  }
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...