2 USER Remote Paint - UPDATED v1.6 - Ses PB

By [Plornt] on Dec 31, 2009

Ok yes i was going to use someone elses paint and add in the info however, i ended up not doing so because i couldnt manage fitting it in.

I was also meant to make it so more than 2 users could join, but you know F*ck it its only paint.

YES IT NOW INCLUDES SESSION PLAYBACK!
This allows you to open a session file and it will draw it as if it was you drawing, its like a recording/animation.

Commands:

/paint Opens the paint dialog, rest is self explanitory
You must invite a user first: Click Connection >> INVITE
Let them install the script and then click connection >> Establish
START DRAWING YEY

[size=20]If you got invited here from another user please do the following[/size]

1) Open up your mirc client
2) Click ALT + R and paste in the below script
3) If your not in dcc chat already, right click the person who invited you, select DCC then select Chat.
4) Inform the user that the script is installed OR type YES into the dialog that pops up.
5) If nothings happened tell the other user to click Connection >> Establish
6) A popup should say your in DCC paint and then start drawing!!!

Screen shot

Image

;; [Plornt]'s 2 way paint 
;; This script uses DCC to send draw events so the other user can see the image on both screens
;; Save and load not available at the moment but will be soon
;; Sends of PC images are also not available yet way to much stuff
;; Script Contents
;; 1) Alias's
;; 2) Tools Sclicks etc
;; 3) Dialog events
;; 4) Dialogs and window events
;; 5) DCC control

;;Section 1 - Alias's

alias box {
  dialog -m msg msg
  did -ar msg 2 $1-
}
alias -l drawline {
  if ($1 != PAINT) {
    if (%p.nick.estab) { msg = [ $+ [ %p.nick.estab ] ] PAINT drawline $1-  }
    write $+($mircdir,\Temp\,%p.time,.tmp) $calc($ctime - %p.time) drawline $1-
    drawline $1-
  }
  else { 
    write $+($mircdir,\Temp\,%p.time,.tmp) $calc($ctime - %p.time) drawline $3-
    drawline $3- 
  }
}
alias -l drawdot {
  if ($1 != PAINT) {
    if (%p.nick.estab) { msg = [ $+ [ %p.nick.estab ] ] PAINT drawdot $1-  }
    write $+($mircdir,\Temp\,%p.time,.tmp) $calc($ctime - %p.time) drawdot $1-
    drawdot $1-
  }
  else {
    write $+($mircdir,\Temp\,%p.time,.tmp) $calc($ctime - %p.time) drawdot $3-  
  drawdot $3- }
}
alias -l drawtext {
  if ($1 != PAINT) {
    if (%p.nick.estab) { msg = [ $+ [ %p.nick.estab ] ] PAINT drawtext $1-  }
    write $+($mircdir,\Temp\,%p.time,.tmp) $calc($ctime - %p.time) drawtext $1-
    drawtext $1-
  } 
  else { 
    write $+($mircdir,\Temp\,%p.time,.tmp) $calc($ctime - %p.time) drawtext $3-
  drawtext $3- }
}
alias -l drawrot {
  if ($1 != PAINT) {
    if (%p.nick.estab) { msg = [ $+ [ %p.nick.estab ] ] PAINT drawrot $1-  }
    write $+($mircdir,\Temp\,%p.time,.tmp) $calc($ctime - %p.time) drawrot $1-
    drawrot $1-
  } 
  else { 
    write $+($mircdir,\Temp\,%p.time,.tmp) $calc($ctime - %p.time) drawrot $3-
  drawrot $3- }
}
alias -l clear {
  if ($1 != PAINT) {
    if (%p.nick.estab) { msg = [ $+ [ %p.nick.estab ] ] PAINT CLEAR $1-  }
    write $+($mircdir,\Temp\,%p.time,.tmp) $calc($ctime - %p.time) clear $1
    CLEAR $1-
  } 
  else {
    write $+($mircdir,\Temp\,%p.time,.tmp) $calc($ctime - %p.time) clear $3-  
  CLEAR $3- }
}
alias addcol {
  did -a paint 5 Black
  did -a paint 5 Yellow
  did -a paint 5 Red
  did -a paint 5 Blue
  did -a paint 5 Green
  did -a paint 5 Light Green
  did -a paint 5 Pink
  did -a paint 5 Purple
  did -a paint 5 Orange
  did -a paint 5 Brown
  did -a paint 5 Baby Blue
}
alias paint {
  dialog -m paint paint
}

;;Section 2 - Tools

ON *:DIALOG:Paint:Sclick:13: {
  did -b paint 13
  did -e paint 8,7,9,16,12

  unset %p.x.* | unset %p.y.*
  box Drag like a line the area you want to Rotate
  set %p.tool 3
}
ON *:DIALOG:Paint:Sclick:11: {
  clear @paint
}
ON *:DIALOG:Paint:Sclick:16: {
  did -b paint 16
  did -e paint 8,7,9,12,13

  unset %p.x.* | unset %p.y.*
  set %p.tool 6
}
ON *:DIALOG:Paint:Sclick:8: {
  did -b paint 8
  did -e paint 16,7,9,12,13

  unset %p.x.* | unset %p.y.*
  set %p.tool 5

}
ON *:DIALOG:Paint:Sclick:7: {
  did -b paint 7
  did -e paint 8,16,9,12,13

  unset %p.x.* | unset %p.y.*
  set %p.tool 2
}
ON *:DIALOG:Paint:Sclick:9: {
  did -b paint 9
  did -e paint 8,7,16,12,13

  unset %p.x.* | unset %p.y.*
  set %p.tool 1
}
ON *:DIALOG:Paint:Sclick:12: {
  did -b paint 12
  did -e paint 8,7,9,16,13
  unset %p.x.* | unset %p.y.*
  if (!$dialog(fonts)) {  dialog -m fonts fonts }
  set %p.tool 4
}

;;Section 3 - Dialog EVENTS

ON *:DIALOG:Paint:CLOSE:*: {
  unset %p.*
  if ($dialog(fonts)) { dialog -c fonts fonts }
  window -c @Paint
  echo -a 3Hope you enjoyed remote dialog beta v1.6
}
ON *:DIALOG:msg:Sclick:1: {
  dialog -c msg
}
ON *:DIALOG:Paint:menu:17: {
  set %p.nick $$?="Who?"
  msg %p.nick Hello $me was woundering if you want to use mirc paint remote? SCRIPT URL: http://www.hawkee.com/snippet/7082/ . If you want to know more just message me :)
  dcc chat %p.nick
  box Sent a message to %p.nick . Please wait for them to install the script, once you know its installed click the establish menu PLEASE OPEN DCC FIRST
}

ON *:DIALOG:Paint:menu:15: {
  if (%p.nick) {
    msg = [ $+ [ %p.nick ] ] PAINT START
  }
  else {
    box Please invite someone first!
  }
}
ON *:DIALOG:fonts:Sclick:3: {
  if ($did(3).state == 1) { set %p.b 1 }
  else { unset %p.b }
}
ON *:DIALOG:fonts:Sclick:4: {
  if ($did(4).state == 1) { set %p.u 1 }
  else { unset %p.u }
}
ON *:DIALOG:Paint:SCROLL:3: {
  did -ar paint 21 $did(3).sel
  set %p.size $did(3).sel
}  
ON *:DIALOG:Paint:SCLICK:5: {
  if ($did(5).seltext == black) { set %p.col $rgb(0,0,0) }
  if ($did(5).seltext == Yellow) { set %p.col $rgb(255,255,0) }
  if ($did(5).seltext == Red) { set %p.col $rgb(255,0,0) }
  if ($did(5).seltext == blue) { set %p.col $rgb(0,0,255) }
  if ($did(5).seltext == green) { set %p.col $rgb(0,192,0) }
  if ($did(5).seltext == light green) { set %p.col $rgb(0,255,0) }
  if ($did(5).seltext == pink) { set %p.col $rgb(255,102,204) }
  if ($did(5).seltext == purple) { set %p.col $rgb(204,0,204) }
  if ($did(5).seltext == Orange) { set %p.col $rgb(255,153,0) }
  if ($did(5).seltext == brown) { set %p.col $rgb(100,0,0) }
  if ($did(5).seltext == baby blue) { set %p.col $rgb(115,140,170) }

}

ON *:DIALOG:Paint:INIT:*: {
  set %p.time $ctime
  window -p @Paint 
  set %p.tool 1
  set %p.col $rgb(0,0,0)
  set %p.size 5
  did -z paint 3 1 100
  addcol
  did -c paint 5 1
  if (!$exists($mircdirTemp/)) { mkdir Temp }

}
ON *:DIALOG:fonts:INIT:*: {
  if (%p.b) { did -c fonts 3 1 }
  if (%p.u) { did -c fonts 4 1 }
  var %fontdir C:\Windows\Fonts\
  var %default ARIAL
  var %x 1
  while (%x <= $findfile(%fontdir,*.*,0)) {
    var %font $remove($findfile(%fontdir,*.*,%x) ,%fontdir,ttf,fon,$chr(46)))
    did -a fonts 1 %font
    if (%font == %default) { did -c fonts 1 %x }
    inc %x
  }
}

;;Section 4 - Dialogs and window events

dialog paint {
  title "Mirc Remote Paint"
  size 10 112 72 272
  option dbu
  text "Brush/Text Size", 2, 17 231 69 10
  scroll "", 3, 13 243 45 8, horizontal top
  text "Colour", 4, 25 205 22 8
  combo 5, 13 216 46 35, drop
  box "Tool box", 6, 6 4 59 124
  button "Line", 7, 17 14 38 13
  button "Eraser", 8, 17 32 38 13
  button "Paint", 9, 17 51 38 13
  button "Clear", 11, 17 165 38 13
  box "Utilities", 1, 6 134 59 55
  box "Options", 10, 6 192 59 77
  button "Text", 12, 17 69 38 13
  button "Quad Tool", 16, 17 86 38 13
  button "Rotate", 13, 17 146 38 13
  edit "x", 18, 19 112 15 10, disable center
  edit "y", 19, 39 112 15 10, disable center
  text " ( X     ,    Y )", 20, 20 102 34 8
  edit "s", 21, 25 252 22 10, disable center
  menu "&File ", 22
  item "New", 30, 22
  menu "&Save As", 23, 22
  item "Bitmap", 25, 23
  item "*.PicSes (REC)", 26, 23
  menu "&Open", 24, 22
  item "Bitmap", 27, 24
  item "Playback", 28, 24
  item "Fast PB", 29, 24
  menu "Connection", 14
  item "Establish", 15, 14
  item "Invite", 17, 14
}
ON *:DIALOG:Paint:menu:30: {
  set %p.time $ctime
  clear @paint
}
ON *:DIALOG:Paint:menu:29: {
  box Please remember, other users can not see this, only you.
  var %file $qt($$sfile($mircdirRemoteFiles\*.PicSes,Open .picses...))
  clear @paint
  if (%file) { 
    var %i 1 
    while (%i <= $lines(%file)) {
      tokenize 32 $read(%file,%i)
      $2-
      inc %i 
    }
  }
}
ON *:DIALOG:Paint:menu:28: {
  box Please remember, other users can not see this, only you.
  var %file $qt($$sfile($mircdirRemoteFiles\*.PicSes,Open .picses...))
  clear @paint
  if (%file) { 
    var %i 1 
    while (%i <= $lines(%file)) {
      .timerpic $+ %i 1 $read(%file,%i)
      inc %i 
    }
  }
}
ON *:DIALOG:Paint:menu:27: {
  box Please remember, other users can not see this, only you.
  drawpic @paint 0 0 $qt($$sfile($mircdirRemoteFiles\*.bmp,Open Bitmap...))

}
alias saveprog {
  var %y 1, %max $lines($+($mircdir,\Temp\,%p.time,.tmp)) 
  var %p.file $1
  while (%y <= %max) {
    write %p.file $read($+($mircdir,\Temp\,%p.time,.tmp), %y)
    inc %y
  }
} 
ON *:DIALOG:Paint:menu:26: {
  if (!$exists($mircdirSessions\)) { mkdir Sessions }
  saveprog $qt($$sfile($mircdirSessions\*.picses,Save as Picture Session Movie...))
}
ON *:DIALOG:Paint:menu:25: {
  if (!$exists($mircdirSessions\)) { mkdir RemoteFiles }
  /drawsave @paint $qt($$sfile($mircdirRemoteFiles\*.bmp,Save as Bitmap...))
}
dialog col {
  title "Colour"
  size -1 -1 346 205
  option pixels
  box "Box", 1, 7 6 330 184
  scroll "r", 2, 61 25 258 16, horizontal top
  text "Red:", 3, 17 25 29 17
  text "Green:", 4, 17 49 35 17
  scroll "g", 5, 61 49 258 16, horizontal top
  text "Blue:", 6, 17 73 29 17
  scroll "b", 7, 61 73 258 16, horizontal top
  icon 8, 14 97 308 40
  button "OK", 9, 253 154 65 25
  button "Cancel", 10, 172 154 65 25
}

dialog paint {
  title "Title"
  size 10 112 72 216
  option dbu

}
dialog msg {
  title "Paint message"
  size -1 -1 244 129
  option pixels
  button "Ok", 1, 90 87 65 25
  text "Loading...", 2, 15 19 211 54
}

dialog fonts {
  title "Font Options"
  size 300 112 376 38
  option pixels
  combo 1, 56 10 165 71, drop
  text "Font", 2, 11 14 39 17
  check "Bold", 3, 232 12 63 17
  check "Underline", 4, 299 12 73 17
}

menu @paint {

  drop:{
    if (%p.tool == 2) { drawline -r @paint %p.col %p.size %mouse.x %mouse.y $mouse.x $mouse.y  | unset %mouse.*  }
    if (%p.tool == 3) { drawrot -m @paint $$?="Angle?" %mouse.x %mouse.y $mouse.x $mouse.y | unset %mouse.*  }

  }
  sclick:{ 
    if (%p.tool == 2) { set %mouse.x $mouse.x | set %mouse.y $mouse.y }
    if (%p.tool == 3) { set %mouse.x $mouse.x | set %mouse.y $mouse.y }
    if (%p.tool == 4) { drawtext -pr @Paint %p.col $did(fonts,1).seltext %p.size $mouse.x $mouse.y $iif(%p.b,,$null) $+ $iif(%p.u,,$null) $+ $$?="Text" }
    if (%p.tool == 6) {
      if (!%p.x.1) { set %p.x.1 $mouse.x | set %p.y.1 $mouse.y | halt } 
      if (!%p.x.2) { set %p.x.2 $mouse.x | set %p.y.2 $mouse.y | halt } 
      if (!%p.x.3) { set %p.x.3 $mouse.x | set %p.y.3 $mouse.y | halt } 
      if (!%p.x.4) { drawline -r @paint %p.col %p.size %p.x.1 %p.y.1 %p.x.2 %p.y.2 %p.x.3 %p.y.3 $mouse.x $mouse.y %p.x.1 %p.y.1 | unset %p.x.* | unset %p.y.* }
    }
  }
  mouse:{
    did -ar paint 18 $mouse.x
    did -ar paint 19 $mouse.y
    if (%p.tool == 1) { | if ($mouse.key & 1) { drawdot -r @paint %p.col %p.size $mouse.x $mouse.y } | }
    if (%p.tool == 5) { | if ($mouse.key & 1) { drawdot -r @paint $rgb(255,255,255) %p.size $mouse.x $mouse.y } | }

  }
}

;; SECTION 5 - DCC

on ^*:CHAT:PAINT START:{
  if ($$?="Accept $nick $+ 's Paint request? Type yes:" == YES) {
    msg =$nick PAINT ACCEPTED
    set %p.time $ctime
    set %p.nick.estab $nick
    box You are now in DCC paint. The other user can see what you are painting.
  }
  else {
    msg =$nick PAINT DECLINED
  }
  haltdef
}
on ^*:CHAT:PAINT ACCEPTED:{
  if ($nick == %p.nick) {
    set %p.nick.estab $nick
    box You are now in DCC paint. The other user can see what you are painting.
    set %p.time $ctime
  }
  haltdef
}
on ^*:CHAT:PAINT DECLINED:{
  if ($nick == %p.nick) {
    box Sorry $nick declined your offer
  }
  haltdef
}

on ^*:CHAT:PAINT *:{

  if (%p.nick.estab) { 
    if ($2 == drawline) { drawline $1- }
    if ($2 == drawdot) { drawdot $1- }
    if ($2 == Clear) { clear $1- }
    if ($2 == drawtext) { drawtext $1- }
    if ($2 == drawrot) { drawrot $1- }
  }
  haltdef
}

Comments

Sign in to comment.
alabama   -  Oct 14, 2011

nice

 Respond  
zenx   -  Mar 07, 2011

Multiplayer paint?

 Respond  
God425   -  Jan 03, 2010

how do u use it

 Respond  
[Plornt]   -  Jan 01, 2010

Added haltdefs so they actually work

 Respond  
[Plornt]   -  Dec 31, 2009

hah didnt realise i already had it coded in so YOU CAN SHOW OTHERS YOUR OTHER SESSIONS !!! :D

need a buffer window but need someone to tell me how >.>

 Respond  
[Plornt]   -  Dec 31, 2009

Now comes with session play back.
Unfortunatly sending a whole session through DCC in one go isnt a great idea... but you know its still pretty cool maby one day ill add it in

 Respond  
Atr   -  Dec 31, 2009

Heh, finally getting round to haltdef'ing it.

/me wonders who suggested that after a pretty alarming spam rape.. xD

 Respond  
[Plornt]   -  Dec 31, 2009

Thanks

Atm im trying to get the connecting a little bit easier, and might make a auto shape box (Stars boxes small lil vector images(Cept there not vector)) im gunna add a halt def inso you dont get spam raped in the dcc.

Also if your running win 7 for some reason it has compatibility errors with mirc dialogs and will probs crash after a bit.

Im adding a save session function so you can play back the whole paint session (in like an animation), also this will then allow me to add Undo and Redo however it will proberbly need a buffer window.

 Respond  
Shinybot   -  Dec 31, 2009

Seems Good :)

 Respond  
DarkCoder   -  Dec 31, 2009

Eh.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.