Advertisement
Guest User

Chat

a guest
Apr 19th, 2023
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 37.44 KB | None | 0 0
  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <!DOCTYPE muclient>
  3.  
  4. <!-- Bits of this plugin and ideas were borrowed and remixed from the MUSHclient community. http://www.gammon.com.au/forum/?id=9385 and others. -->
  5. <!-- Modifications for Aardwolf and extra awesome sauce added by Fiendish with help from Orogan -->
  6. <!-- Adapated by Nick Gammon for Smaug and similar MUDs -->
  7.  
  8. <muclient>
  9. <plugin
  10. name="Miniwindow"
  11. author="Fiendish"
  12. id="565dae21eb816a2fdb8d50f9"
  13. language="Lua"
  14. purpose="Move chats to a miniwindow"
  15. date_written="2010-04-04"
  16. date_modified="2011-01-05"
  17. requires="4.52"
  18. version="2.4"
  19. save_state="y"
  20. >
  21.  
  22. <description trim="y">
  23. USAGE:
  24.  
  25. chats echo on : echo chats in main window
  26. chats echo off : do not echo chats
  27. chats show : show chats window
  28. chats hide : hide chats window
  29.  
  30. LH-click a line to copy it to the clipboard
  31. RH-click main window to see menu of options
  32.  
  33. Click title bar to drag window.
  34. </description>
  35.  
  36. </plugin>
  37.  
  38. <triggers>
  39.  
  40. <trigger
  41. enabled="y"
  42. match="(Dr. Thaung|Ragnarok the Flame Salamander|Minut|Holly|Grim|Dr. Briefs|Happy Tourist|Satan City Tour Guide|Capsule Corp Reclamation Droid|Jamaican Drug Dealer|Ancient Nexus Guardian|Old Hag|Head Postmaster|Bio Truffle Scientist|Fiera the Executioner|Malevolenia|Malevolenia the Black Widow|Avatar of Hate|Avatar of Fear|Avatar of Rage|Blix|Advanced Fighter|Average Fighter) (says|mutters|exclaims|asks), "
  43. regexp="y"
  44. script=" "
  45. sequence="1"
  46. >
  47. </trigger>
  48.  
  49. <trigger
  50. enabled="y"
  51. match="[Infinity] ::*::"
  52. script="chats"
  53. omit_from_output="y"
  54. sequence="100"
  55. ></trigger>
  56.  
  57. <trigger
  58. enabled="y"
  59. match="^\[Auction\:"
  60. regexp="y"
  61. script="chats"
  62. sequence="100"
  63. >
  64. </trigger>
  65.  
  66. <trigger
  67. enabled="y"
  68. match="\[HARDCORE\]"
  69. regexp="y"
  70. script="chats"
  71. sequence="100"
  72. >
  73. </trigger>
  74.  
  75. <trigger
  76. enabled="y"
  77. match="^\-\<OOC\>\-"
  78. regexp="y"
  79. script="chats"
  80. sequence="100"
  81. >
  82. </trigger>
  83.  
  84. <trigger
  85. enabled="y"
  86. match="(tells you|you tell)"
  87. regexp="y"
  88. script="chats"
  89. sequence="100"
  90. >
  91. </trigger>
  92.  
  93. <trigger
  94. enabled="y"
  95. match="You Have 2 minutes to 'say' the three numbers displayed above!"
  96. regexp="y"
  97. script="chats"
  98. sequence="100"
  99. >
  100. </trigger>
  101.  
  102.  
  103. <trigger
  104. enabled="y"
  105. match="^(.*?)\[(.*?)\]\: (.*?)$"
  106. regexp="y"
  107. script="chats"
  108. sequence="100"
  109. >
  110. </trigger>
  111.  
  112. <trigger
  113. enabled="y"
  114. match="You tell"
  115. regexp="y"
  116. script="chats"
  117. sequence="100"
  118. >
  119. </trigger>
  120.  
  121.  
  122. <trigger
  123. enabled="y"
  124. match="You say"
  125. regexp="y"
  126. script="chats"
  127. sequence="100"
  128. >
  129. </trigger>
  130.  
  131.  
  132.  
  133.  
  134. <trigger
  135. enabled="y"
  136. match="^(.*?)\[Info\]\: (.*?)$"
  137. regexp="y"
  138. script="chats"
  139. sequence="100"
  140. >
  141. </trigger>
  142.  
  143. <trigger
  144. enabled="y"
  145. match="^(.*?)[A-Za-z]+ (say|chat|mutter||\[Newbie\]|exclaim|ask|yell|\[OOC\]|sends a scouter transmission to|\(Holler\)|\(Shout\)|\(Music\)|\(Roleplay\)|\(Quote\)|\(Congrat\)|\(Quest\)|OOC say|)s, \'(.*?)\'$"
  146. regexp="y"
  147. script="chats"
  148. sequence="100"
  149. >
  150. </trigger>
  151.  
  152. <trigger
  153. enabled="y"
  154. match="^(.*?)\[A-Za-z]+ exclaims, \'(.*?)\'$"
  155. regexp="y"
  156. script="chats"
  157. sequence="100"
  158. >
  159. </trigger>
  160.  
  161. <trigger
  162. enabled="y"
  163. match="^(.*?)[A-Za-z]+ tells the group, \'(.*?)\'$"
  164. regexp="y"
  165. script="chats"
  166. sequence="100"
  167. >
  168. </trigger>
  169.  
  170.  
  171. <trigger
  172. enabled="y"
  173. match="^(.*?)\[A-Za-z]+ (exclaim)s, \'(.*?)\!'$"
  174. regexp="y"
  175. script="chats"
  176. sequence="100"
  177. >
  178. </trigger>
  179.  
  180.  
  181. <trigger
  182. enabled="y"
  183. match="^(.*?)\[A-Za-z]+ asks, \'(.*?)\?'$"
  184. regexp="y"
  185. script="chats"
  186. sequence="100"
  187. >
  188. </trigger>
  189.  
  190. <trigger
  191. enabled="y"
  192. match="^(.*?)\(QUESTION\) (.*?)\:(.*?)$"
  193. regexp="y"
  194. script="chats"
  195. sequence="100"
  196. >
  197. </trigger>
  198.  
  199. <trigger
  200. enabled="y"
  201. match="^(.*?)\[FreedomOfSpeech\] (.*?)$"
  202. regexp="y"
  203. script="chats"
  204. sequence="100"
  205. >
  206. </trigger>
  207.  
  208. <trigger
  209. enabled="y"
  210. match="^(.*?)\[TRAFFIC\-(.*?)\](.*?)$"
  211. regexp="y"
  212. script="chats"
  213. sequence="100"
  214. >
  215. </trigger>
  216.  
  217. <trigger
  218. enabled="y"
  219. match="^(.*?)\[MuSiC\] (.*?)$"
  220. regexp="y"
  221. script="chats"
  222. sequence="100"
  223. >
  224. </trigger>
  225.  
  226. <trigger
  227. enabled="y"
  228. match="^(.*?)\[RolePlay\](.*?)$"
  229. regexp="y"
  230. script="chats"
  231. sequence="100"
  232. >
  233. </trigger>
  234.  
  235. <trigger
  236. enabled="y"
  237. match="^(.*?)\[RolePlay\:OOC\](.*?)$"
  238. regexp="y"
  239. script="chats"
  240. sequence="100"
  241. >
  242. </trigger>
  243.  
  244. <trigger
  245. enabled="y"
  246. match="^(.*?)Auction\:(.*?)$"
  247. regexp="y"
  248. script="chats"
  249. sequence="100"
  250. >
  251. </trigger>
  252.  
  253. <trigger
  254. enabled="y"
  255. match="^(.*?)\You send a transmission to (.*?)\, \'(.*?)\'$"
  256. regexp="y"
  257. script="chats"
  258. sequence="100"
  259. >
  260. </trigger>
  261.  
  262. <trigger
  263. enabled="y"
  264. match="^(.*?)\>\>(.*?)\<\<(.*?)$"
  265. regexp="y"
  266. script="chats"
  267. sequence="100"
  268. >
  269. </trigger>
  270.  
  271. <trigger
  272. enabled="y"
  273. match="^(.*?)\You whisper to (.*?)\, \'(.*?)\'$"
  274. regexp="y"
  275. script="chats"
  276. sequence="100"
  277. >
  278. </trigger>
  279.  
  280. <trigger
  281. enabled="y"
  282. match="^(.*?)[A-Za-z]+ sends a transmission to you, \'(.*?)\'$"
  283. regexp="y"
  284. script="chats"
  285. sequence="100"
  286. >
  287. </trigger>
  288.  
  289. <trigger
  290. enabled="y"
  291. match="^(.*?)[A-Za-z]+ whispers to you, \'(.*?)\'$"
  292. regexp="y"
  293. script="chats"
  294. sequence="100"
  295. >
  296. </trigger>
  297.  
  298. <trigger
  299. enabled="y"
  300. match="^(.*?)\[TRAFFIC\-(.*?)\](.*?)$"
  301. regexp="y"
  302. script="chats"
  303. sequence="100"
  304. >
  305. </trigger>
  306.  
  307. <trigger
  308. enabled="y"
  309. match="^(.*?)\/TRIVIA\/\/(.*?)$"
  310. regexp="y"
  311. script="chats"
  312. sequence="100"
  313. >
  314. </trigger>
  315.  
  316. <trigger
  317. enabled="y"
  318. match="^(.*?)\-\=\[Misc\|(.*?)$"
  319. regexp="y"
  320. script="chats"
  321. sequence="100"
  322. >
  323. </trigger>
  324.  
  325. <trigger
  326. enabled="y"
  327. match="^(.*?)\{WARTALK\|(.*?)$"
  328. regexp="y"
  329. script="chats"
  330. sequence="100"
  331. >
  332. </trigger>
  333.  
  334. <trigger
  335. enabled="y"
  336. match="^(.*?) says (.*?)$"
  337. regexp="y"
  338. script="chats"
  339. sequence="100"
  340. >
  341. </trigger>
  342.  
  343. <trigger
  344. enabled="y"
  345. match="^(.*?) \((.*?)\)\: (.*?)$"
  346. regexp="y"
  347. script="chats"
  348. sequence="100"
  349. >
  350. </trigger>
  351.  
  352.  
  353. <trigger
  354. enabled="y"
  355. match="You RP Chat\: \'(.*?)\'$"
  356. regexp="y"
  357. script="chats"
  358. sequence="100"
  359. >
  360. </trigger>
  361.  
  362. <trigger
  363. enabled="y"
  364. match="^(.*?) RP Chats\: \'(.*?)\'$"
  365. regexp="y"
  366. script="chats"
  367. sequence="100"
  368. >
  369. </trigger>
  370.  
  371.  
  372. <trigger
  373. enabled="y"
  374. match="\[Admin\] (.*?)$"
  375. regexp="y"
  376. script="chats"
  377. sequence="100"
  378. >
  379. </trigger>
  380.  
  381. <trigger
  382. enabled="y"
  383. match="\[Wiznet\] (.*?)$"
  384. regexp="y"
  385. script="chats"
  386. sequence="100"
  387. >
  388. </trigger>
  389.  
  390. <trigger
  391. enabled="y"
  392. match="^(?:\[Pl\:[\d\,\-\=\!]+\]\[Ki\:[\d\,\-\=\!]+\]\[\d+\% EXP\]\[\w+\: \d+\%\](?:\[HT\])?(?:\[FM\])?(?:\[K\])?)?(?:(?:You get|[\.\-\'\!\w\s]+ (drops)) (Essence of (Fate|Power|Mind)|(?:Namekian )?(One|Two|Three|Four|Five|Six|Seven) Star Dragonball|Battle Token|Gauntlet of Evil|(Destiny|Forever|Eternal) Essence)(?: on the ground before dying)?|RANDOM BOT CHECK|You have 2 minutes to \'say\' the three numbers displayed above|You feel your body tense as the dull light of the Makyo Star begins shining down on to you\. Energy from the star begins penetrating your body\, as your cells begin reacting violently\, each erupting with power as your body begins to twist and transform\. Your bones begin to crack and reshape themselves as your muscles bulge out with incredible force\, as a dark aura begins swirling about you\. A final explosion of power comes from within you\, sending debris flying as your body now stands fully empowered by the Makyo Star\. |You look at the moon and begin to lose control and rage takes over your mind\, you see nothing but red and begin to transform\, you begin to grow and hair develops all over your body\! You quickly transform into a large Oozaru|Your body starts to shake as a dark aura consumes your body\. You look in the sky and notice the Vanished Moon coming into orbit\. Your eyes quiver as everything seems to move in slow motion as your power reaches its max)\!?\.?$"
  393. regexp="y"
  394. script="chats"
  395. name="rare_drop"
  396. keep_evaluating="y"
  397. sequence="5"
  398. >
  399. </trigger>
  400.  
  401. <trigger
  402. enabled="y"
  403. ignore_case="y"
  404. keep_evaluating="y"
  405. match="^(?:\[Pl\:[\d\,\-\=\!]+\]\[Ki\:[\d\,\-\=\!]+\]\[\d+\% EXP\]\[\w+\: \d+\%\](?:\[HT\])?(?:\[FM\])?(?:\[K\])?)?(\[Mental Awareness Bonus \+\d+ Ki\]|\[Knowledge Bonus \+\d+ Lp\]|\[Inner Strength Bonus \+\d+ Pl\]|\[Damroll Bonus \+\d+\]|\[Hitroll Bonus \+\d+\])$"
  406. regexp="y"
  407. name="rare_bonus"
  408. script="chats"
  409. sequence="5"
  410. >
  411. </trigger>
  412.  
  413. <trigger
  414. enabled="y"
  415. match="(?:\[Pl\:[\d\,\-\=\!]+\]\[Ki\:[\d\,\-\=\!]+\]\[\d+\% EXP\]\[\w+\: \d+\%\](?:\[HT\])?(?:\[FM\])?(?:\[K\])?)?(?:\w+ throws? \w+ dice and gets?\.\.\.|\[\d+\] \-\=\- \[\d+\] +\((?:Snake Eyes|Total\: \d+)\))"
  416. regexp="y"
  417. script="chats"
  418. keep_evaluating="y"
  419. sequence="5"
  420. >
  421. </trigger>
  422.  
  423.  
  424. <trigger
  425. enabled="y"
  426. match="^(.*?)\You (say|chat|exclaim|mutter|ask|yell|\[Newbie\]|\[OOC\]|send a scouter transmission to|\(Holler\)|\(Shout\)|\(Music\)|\(Roleplay\)|\(Quote\)|\(Congrat\)|\(Quest\)|OOC say|tell the group), \'(.*?)\'$"
  427. regexp="y"
  428. script="chats"
  429. sequence="100"
  430. >
  431. </trigger>
  432.  
  433.  
  434. <trigger
  435. enabled="y"
  436. match="^(.*?)\SNET(.*?)$"
  437. regexp="y"
  438. script="chats"
  439. sequence="100"
  440. >
  441. </trigger>
  442.  
  443. </triggers>
  444.  
  445. <aliases>
  446. <alias
  447. script="chat_echo"
  448. match="^chats echo( on| off)?$"
  449. enabled="y"
  450. regexp="y"
  451. sequence="100"
  452. ignore_case="y"
  453. ></alias>
  454.  
  455. <alias
  456. script="chat_show"
  457. match="chats show"
  458. enabled="y"
  459. sequence="100"
  460. ignore_case="y"
  461. ></alias>
  462.  
  463. <alias
  464. script="chat_hide"
  465. match="chats hide"
  466. enabled="y"
  467. sequence="100"
  468. ignore_case="y"
  469. ></alias>
  470.  
  471. </aliases>
  472.  
  473. <script>
  474. <![CDATA[
  475.  
  476. require "movewindow" -- load the movewindow.lua module
  477. require "copytable"
  478.  
  479. BODY_FONT_NAME = "Arial"
  480. BODY_FONT_SIZE = 9
  481. SCROLL_BAR_WIDTH = 15
  482. MAX_LINES = 10000 -- how many lines to store in scrollback
  483.  
  484. -- date_format = "[%d %b %H:%M:%S] " -- [30 Aug 13:29:49] date and time 24 hour
  485. -- date_format = "[%d %b %I:%M:%S%p] " -- [30 Aug 01:20:12PM] date and time 12 hour
  486. -- date_format = "[%H:%M:%S] " -- [13:29:08] time 24 hour
  487. -- date_format = "[%X] " -- [1:22:06 PM] time 12 hour
  488.  
  489. TIMESTAMP_TEXT_COLOUR = "white"
  490. TIMESTAMP_BACK_COLOUR = "black"
  491.  
  492. -- doing it this way makes them default to true the first time around
  493. timestamp = not (GetVariable("timestamp") == "false")
  494. echo = not (GetVariable("echo") == "false")
  495.  
  496. date_format = GetVariable("date_format")
  497. WINDOW_WIDTH = tonumber(GetVariable("WINDOW_WIDTH"))
  498. WINDOW_HEIGHT = tonumber(GetVariable("WINDOW_HEIGHT"))
  499.  
  500. -- offset of text from edge
  501. TEXT_INSET = 5
  502.  
  503. -- where to store the chat line
  504. lines = {} -- table of recent chat lines
  505. rawlines = {}
  506.  
  507. lineStart = ""
  508. lineEnd = ""
  509. WINDOW_COLUMNS = ""
  510. WINDOW_LINES = ""
  511.  
  512. theme = {
  513. WINDOW_BACKGROUND = ColourNameToRGB ("#000000"), -- for miniwindow body
  514. WINDOW_BORDER = ColourNameToRGB("#E8E8E8"), -- for miniwindow body
  515.  
  516. HIGHLIGHT=ColourNameToRGB("#FFFFFF"), -- for 3D surfaces
  517. FACE=ColourNameToRGB("#D4D0C8"), -- for 3D surfaces
  518. INNERSHADOW=ColourNameToRGB("#808080"), -- for 3D surfaces
  519. OUTERSHADOW = ColourNameToRGB("#404040"), -- for 3D surfaces
  520.  
  521. BACK_FACE = ColourNameToRGB ("#E8E8E8"), -- for contrasting details
  522. DETAIL = ColourNameToRGB ("#000000"), -- for contrasting details
  523.  
  524. TITLE_HEIGHT = 17, -- for miniwindow title area
  525. SUBTITLE_HEIGHT = 17, -- for miniwindow title area
  526. TITLE_FONT_NAME = "Dina", -- for miniwindow title area
  527. TITLE_FONT_SIZE = 8 -- for miniwindow title area
  528. } -- end theme table
  529.  
  530.  
  531. -- replacement for WindowRectOp action 5, which allows for a 3D look while maintaining color theme
  532. -- Requires global theme.HIGHLIGHT, theme.FACE, theme.INNERSHADOW, and theme.OUTERSHADOW rgb colors to be set.
  533. function DrawThemed3DRect(Window, left, top, right, bottom)
  534. WindowRectOp(Window, miniwin.rect_fill, left, top, right, bottom, theme.FACE)
  535. WindowLine(Window, left, top, right, top, theme.HIGHLIGHT,
  536. miniwin.pen_solid + miniwin.pen_endcap_flat, 1)
  537. WindowLine(Window, left, top, left, bottom, theme.HIGHLIGHT,
  538. miniwin.pen_solid + miniwin.pen_endcap_flat, 1)
  539. WindowLine(Window, left, bottom-2, right, bottom-2, theme.INNERSHADOW,
  540. miniwin.pen_solid + miniwin.pen_endcap_flat, 1)
  541. WindowLine(Window, right-2, top, right-2, bottom-2, theme.INNERSHADOW,
  542. miniwin.pen_solid + miniwin.pen_endcap_flat, 1)
  543. WindowLine(Window, left, bottom-1, right, bottom-1, theme.OUTERSHADOW,
  544. miniwin.pen_solid + miniwin.pen_endcap_flat, 1)
  545. WindowLine(Window, right-1, top, right-1, bottom-1, theme.OUTERSHADOW,
  546. miniwin.pen_solid + miniwin.pen_endcap_flat, 1)
  547. end
  548.  
  549. function DrawThemedResizeTag(Window, x1, y1, size)
  550. local x2, y2 = x1+size, y1+size
  551. DrawThemed3DRect(Window, x1, y1, x2, y2)
  552. local m = 2
  553. local n = 2
  554. while (x1+m+2 <= x2-3 and y1+n+1 <= y2-4) do
  555. WindowLine(Window, x1+m+1, y2-4, x2-3, y1+n, theme.HIGHLIGHT,
  556. miniwin.pen_solid, 1)
  557. WindowLine(Window, x1+m+2, y2-4, x2-3, y1+n+1, theme.INNERSHADOW,
  558. miniwin.pen_solid, 1)
  559. m = m+3
  560. n = n+3
  561. end
  562. end -- function DrawThemedResizeTag
  563.  
  564.  
  565. Win = GetPluginID()
  566. font_height = ""
  567. line_height = ""
  568. windowinfo = ""
  569. startx = ""
  570. starty = ""
  571.  
  572. function ResizeMoveCallback()
  573. posx, posy = WindowInfo (Win, 17), WindowInfo (Win, 18)
  574. if (WindowTextWidth(Win, "titlefont"..Win, "WWWCOMMUNICATION")+2*SCROLL_BAR_WIDTH <= WINDOW_WIDTH+posx-startx) then
  575. WINDOW_WIDTH = WINDOW_WIDTH+posx-startx
  576. startx = posx
  577. end -- if
  578. if (3*SCROLL_BAR_WIDTH+10+line_height+theme.TITLE_HEIGHT <= WINDOW_HEIGHT+posy-starty) then
  579. WINDOW_HEIGHT = WINDOW_HEIGHT+posy-starty
  580. starty = posy
  581. end -- if
  582. init(false)
  583. end -- function ResizeMoveCallback
  584.  
  585. function ResizeReleaseCallback()
  586. WINDOW_HEIGHT = theme.TITLE_HEIGHT+(line_height*(WINDOW_LINES-1))+3
  587. init(true)
  588. end -- ResizeReleaseCallback
  589.  
  590. function OnPluginInstall()
  591. -- Dummy window to get font characteristics
  592. check (WindowCreate (Win, 0, 0, 1, 1, 0, 0, theme.WINDOW_BACKGROUND) )
  593. check (WindowFont(Win, "bodyfont"..Win, BODY_FONT_NAME, BODY_FONT_SIZE))
  594. check (WindowFont(Win, "titlefont"..Win, theme.TITLE_FONT_NAME, theme.TITLE_FONT_SIZE))
  595. font_height = WindowFontInfo (Win, "bodyfont"..Win, 1) - WindowFontInfo (Win, "bodyfont"..Win, 4) + 1
  596. line_height = font_height+1
  597. font_width = WindowTextWidth (Win, "bodyfont"..Win, "W")
  598.  
  599. -- install the window movement handler, get back the window position
  600. windowinfo = movewindow.install (Win, miniwin.pos_top_right, miniwin.create_absolute_location, true)
  601.  
  602. -- check for Echo/Timestamp/date_format/window size (in pixels) variables, if not there, set them
  603. if date_format == nil then
  604. date_format = "[%d %b %H:%M:%S] "
  605. end -- if
  606. if WINDOW_WIDTH == nil then
  607. WINDOW_WIDTH = (font_width*80)+SCROLL_BAR_WIDTH -- 80 columns
  608. end
  609. if WINDOW_HEIGHT == nil then
  610. WINDOW_HEIGHT = theme.TITLE_HEIGHT+(line_height*6)+2 -- 6 lines
  611. end -- if
  612. init(true)
  613. OnPluginEnable () -- do initialization stuff
  614. end -- function OnPluginInstall
  615.  
  616. function init(firstTime)
  617. -- how many lines and columns will fit?
  618. WINDOW_LINES = math.ceil((WINDOW_HEIGHT-theme.TITLE_HEIGHT)/line_height)
  619. WINDOW_COLUMNS = math.ceil((WINDOW_WIDTH-SCROLL_BAR_WIDTH)/font_width)
  620.  
  621. if firstTime then
  622. WindowCreate(Win, windowinfo.window_left, windowinfo.window_top, WINDOW_WIDTH, WINDOW_HEIGHT, windowinfo.window_mode, windowinfo.window_flags, theme.WINDOW_BACKGROUND)
  623.  
  624. -- catch for right-click menu and line selection
  625. WindowAddHotspot(Win, "textarea", 0, theme.TITLE_HEIGHT, WINDOW_WIDTH-SCROLL_BAR_WIDTH,0,
  626. "", "", "MouseDown", "CancelMouseDown", "MouseUp", "",
  627. miniwin.cursor_ibeam, 0)
  628. -- add the drag handler so they can move the window around
  629. movewindow.add_drag_handler (Win, 0, 0, 0, theme.TITLE_HEIGHT)
  630.  
  631. -- scroll bar up/down buttons
  632. WindowAddHotspot(Win, "up", WINDOW_WIDTH-SCROLL_BAR_WIDTH, theme.TITLE_HEIGHT, 0, theme.TITLE_HEIGHT+SCROLL_BAR_WIDTH,
  633. "MouseOver", "CancelMouseOver", "MouseDown", "CancelMouseDown", "MouseUp", "",
  634. miniwin.cursor_hand, 0)
  635. WindowAddHotspot(Win, "down", WINDOW_WIDTH-SCROLL_BAR_WIDTH, WINDOW_HEIGHT-(2*SCROLL_BAR_WIDTH), 0, WINDOW_HEIGHT-SCROLL_BAR_WIDTH,
  636. "MouseOver", "CancelMouseOver", "MouseDown", "CancelMouseDown", "MouseUp", "",
  637. miniwin.cursor_hand, 0)
  638.  
  639. -- add the resize widget hotspot
  640. WindowAddHotspot(Win, "resizer", WINDOW_WIDTH-SCROLL_BAR_WIDTH, WINDOW_HEIGHT-SCROLL_BAR_WIDTH, WINDOW_WIDTH, WINDOW_HEIGHT,
  641. "MouseOver", "CancelMouseOver", "MouseDown", "CancelMouseDown", "MouseUp", "",
  642. miniwin.cursor_nw_se_arrow, 0)
  643. WindowDragHandler(Win, "resizer", "ResizeMoveCallback", "ResizeReleaseCallback", 0)
  644. else
  645. WindowResize(Win, WINDOW_WIDTH, WINDOW_HEIGHT, theme.WINDOW_BACKGROUND)
  646. WindowMoveHotspot(Win, "textarea", 0, theme.TITLE_HEIGHT, WINDOW_WIDTH-SCROLL_BAR_WIDTH, 0)
  647. WindowMoveHotspot(Win, "up", WINDOW_WIDTH-SCROLL_BAR_WIDTH, theme.TITLE_HEIGHT, 0, theme.TITLE_HEIGHT+SCROLL_BAR_WIDTH)
  648. WindowMoveHotspot(Win, "down", WINDOW_WIDTH-SCROLL_BAR_WIDTH, WINDOW_HEIGHT-(2*SCROLL_BAR_WIDTH), 0, WINDOW_HEIGHT-SCROLL_BAR_WIDTH)
  649. WindowMoveHotspot(Win, "resizer", WINDOW_WIDTH-SCROLL_BAR_WIDTH, WINDOW_HEIGHT-SCROLL_BAR_WIDTH, WINDOW_WIDTH, 0)
  650. end -- if
  651. WindowShow(Win, true)
  652.  
  653. if (firstTime == true) then
  654. lines = {}
  655. for _,styles in ipairs(rawlines) do
  656. fillBuffer(styles)
  657. end -- for each line
  658. end -- if
  659.  
  660. lineStart = math.max(1, #lines-WINDOW_LINES+2)
  661. lineEnd = math.max(1, #lines)
  662. refresh()
  663. end -- function init
  664.  
  665. function OnPluginClose ()
  666. -- if enabled
  667. if GetPluginInfo (GetPluginID(), 17) then
  668. OnPluginDisable()
  669. end -- if enabled
  670. end -- function OnPluginClose
  671.  
  672. function OnPluginEnable ()
  673. WindowShow (Win, true)
  674. end -- function OnPluginEnable
  675.  
  676. function OnPluginSaveState ()
  677. -- save window current location for next time
  678. SetVariable ("enabled", tostring (GetPluginInfo (GetPluginID(), 17)))
  679. movewindow.save_state (Win)
  680. -- save echo/timestamp status
  681. SetVariable ("echo", tostring (echo))
  682. SetVariable ("timestamp", tostring (timestamp))
  683. SetVariable("date_format", date_format)
  684. SetVariable("WINDOW_WIDTH", WINDOW_WIDTH)
  685. SetVariable("WINDOW_HEIGHT", WINDOW_HEIGHT)
  686. end -- function OnPluginSaveState
  687.  
  688. function OnPluginDisable ()
  689. WindowShow( Win, false )
  690. end -- function OnPluginDisable
  691.  
  692. -- display one line
  693. function Display_Line (line, styles)
  694.  
  695. local left = TEXT_INSET
  696. local top = theme.TITLE_HEIGHT + (line * line_height) + 1
  697. local bottom = top + line_height
  698. local font = "bodyfont" .. Win
  699.  
  700. if backfill then
  701. WindowRectOp (Win, miniwin.rect_fill, 1, top, WINDOW_WIDTH - SCROLL_BAR_WIDTH, bottom, ColourNameToRGB("#333333"))
  702. end -- backfill
  703.  
  704. if (styles) then
  705. for _, style in ipairs (styles) do
  706. local width = WindowTextWidth (Win, font, style.text) -- get width of text
  707. local right = left + width
  708. WindowRectOp (Win, miniwin.rect_fill, left, top, right, bottom, style.backcolour) -- draw background
  709. WindowText (Win, font, style.text, left, top, 0, 0, style.textcolour) -- draw text
  710. left = left + width -- advance horizontally
  711. end -- for each style run
  712. end -- if styles
  713.  
  714. end -- Display_Line
  715.  
  716.  
  717. -- display all visible lines
  718. function writeLines()
  719. for count = lineStart, lineEnd do
  720. Display_Line( count-lineStart, lines[count][1], false )
  721. end -- for each line
  722. Redraw()
  723.  
  724. end -- function writeLines
  725.  
  726. -- clear and redraw
  727. function refresh()
  728. WindowRectOp(Win, miniwin.rect_fill, 0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, theme.WINDOW_BACKGROUND)
  729. drawStuff()
  730. end -- function refresh
  731.  
  732. barPos = ""
  733. barSize = ""
  734. totalSteps = ""
  735.  
  736. function drawStuff()
  737. -- draw border
  738. WindowRectOp (Win, miniwin.rect_frame, 0, 0, 0, 0, theme.WINDOW_BORDER)
  739.  
  740. -- Title bar
  741. DrawThemed3DRect(Win, 0, 0, WINDOW_WIDTH, theme.TITLE_HEIGHT)
  742.  
  743. -- Title text
  744. WindowText(Win, "titlefont"..Win, "Chat Capture", ((WINDOW_WIDTH)-(7.5*line_height))/2, (theme.TITLE_HEIGHT-line_height)/2, WINDOW_WIDTH, theme.TITLE_HEIGHT, theme.DETAIL, false)
  745.  
  746. if #lines >= 1 then
  747. writeLines()
  748. end -- if
  749.  
  750. -- Scrollbar base
  751. WindowRectOp(Win, miniwin.rect_fill, WINDOW_WIDTH-SCROLL_BAR_WIDTH, theme.TITLE_HEIGHT, WINDOW_WIDTH, WINDOW_HEIGHT, theme.BACK_FACE) -- scroll bar background
  752. WindowRectOp(Win, miniwin.rect_frame, WINDOW_WIDTH-SCROLL_BAR_WIDTH+1, SCROLL_BAR_WIDTH+theme.TITLE_HEIGHT+1, WINDOW_WIDTH-1, WINDOW_HEIGHT-(2*SCROLL_BAR_WIDTH)-1, theme.DETAIL) -- scroll bar background inset rectangle
  753. DrawThemed3DRect(Win, WINDOW_WIDTH-SCROLL_BAR_WIDTH, theme.TITLE_HEIGHT, WINDOW_WIDTH, theme.TITLE_HEIGHT+SCROLL_BAR_WIDTH) -- top scroll button
  754. DrawThemed3DRect(Win, WINDOW_WIDTH-SCROLL_BAR_WIDTH, WINDOW_HEIGHT-(SCROLL_BAR_WIDTH*2), WINDOW_WIDTH, WINDOW_HEIGHT-SCROLL_BAR_WIDTH) -- bottom scroll button
  755.  
  756. -- draw triangle in up button
  757. points = string.format ("%i,%i,%i,%i,%i,%i", (WINDOW_WIDTH-SCROLL_BAR_WIDTH)+2, theme.TITLE_HEIGHT+8,(WINDOW_WIDTH-SCROLL_BAR_WIDTH)+6, theme.TITLE_HEIGHT+4,(WINDOW_WIDTH-SCROLL_BAR_WIDTH)+10, theme.TITLE_HEIGHT+8)
  758. WindowPolygon (Win, points,
  759. theme.DETAIL, miniwin.pen_solid, 1, -- pen (solid, width 1)
  760. theme.DETAIL, miniwin.brush_solid, --brush (solid)
  761. true, --close
  762. false) --alt fill
  763.  
  764. -- draw triangle in down button
  765. points = string.format ("%i,%i,%i,%i,%i,%i", (WINDOW_WIDTH-SCROLL_BAR_WIDTH)+2, (WINDOW_HEIGHT-SCROLL_BAR_WIDTH)-10,(WINDOW_WIDTH-SCROLL_BAR_WIDTH)+6, (WINDOW_HEIGHT-SCROLL_BAR_WIDTH)-6, (WINDOW_WIDTH-SCROLL_BAR_WIDTH)+10,(WINDOW_HEIGHT-SCROLL_BAR_WIDTH)-10)
  766. WindowPolygon (Win, points,
  767. theme.DETAIL, miniwin.pen_solid, 1, -- pen (solid, width 1)
  768. theme.DETAIL, miniwin.brush_solid, --brush (solid)
  769. true, --close
  770. false) --alt fill
  771.  
  772. -- The scrollbar position indicator
  773. totalSteps = #lines
  774. if (totalSteps <= WINDOW_LINES-1) then totalSteps = 1 end
  775. SCROLL_BAR_HEIGHT = (WINDOW_HEIGHT-(3*SCROLL_BAR_WIDTH)-theme.TITLE_HEIGHT)
  776. if (not dragscrolling) then
  777. stepNum = lineStart-1
  778. barPos = SCROLL_BAR_WIDTH +theme.TITLE_HEIGHT+ ((SCROLL_BAR_HEIGHT/totalSteps) * stepNum)
  779. barSize = (SCROLL_BAR_HEIGHT/math.max(WINDOW_LINES-1,totalSteps)) * (WINDOW_LINES-1)
  780. if barSize < 10 then
  781. barSize = 10
  782. end
  783. if barPos+barSize > SCROLL_BAR_WIDTH+theme.TITLE_HEIGHT+SCROLL_BAR_HEIGHT then
  784. barPos = SCROLL_BAR_WIDTH+theme.TITLE_HEIGHT+SCROLL_BAR_HEIGHT - barSize
  785. end
  786. WindowAddHotspot(Win, "scroller", (WINDOW_WIDTH-SCROLL_BAR_WIDTH), barPos, WINDOW_WIDTH, barPos+barSize,
  787. "MouseOver", "CancelMouseOver", "MouseDown", "CancelMouseDown", "MouseUp", "",
  788. miniwin.cursor_hand, 0)
  789. WindowDragHandler(Win, "scroller", "ScrollerMoveCallback", "ScrollerReleaseCallback", 0)
  790. end -- if
  791. DrawThemed3DRect(Win, WINDOW_WIDTH-SCROLL_BAR_WIDTH, barPos, WINDOW_WIDTH, barPos+barSize)
  792.  
  793. -- resizer tag
  794. DrawThemedResizeTag(Win, WINDOW_WIDTH-SCROLL_BAR_WIDTH, WINDOW_HEIGHT-SCROLL_BAR_WIDTH, SCROLL_BAR_WIDTH)
  795.  
  796. Redraw()
  797. end -- function drawStuff
  798.  
  799. function ScrollerMoveCallback(flags, hotspot_id)
  800. mouseposy = WindowInfo(Win, 18)
  801. windowtop = WindowInfo(Win, 2)
  802. barPos = math.max(mouseposy-windowtop+clickdelta, SCROLL_BAR_WIDTH+theme.TITLE_HEIGHT)
  803. if barPos > WINDOW_HEIGHT-(SCROLL_BAR_WIDTH*2)-barSize then
  804. barPos = WINDOW_HEIGHT-(SCROLL_BAR_WIDTH*2)-barSize
  805. lineStart = math.max(1,#lines-WINDOW_LINES+2)
  806. lineEnd = #lines
  807. else
  808. lineStart = math.floor((barPos-SCROLL_BAR_WIDTH-theme.TITLE_HEIGHT)/(SCROLL_BAR_HEIGHT/totalSteps)+1)
  809. lineEnd = math.min(lineStart + WINDOW_LINES-2, #lines)
  810. end -- if
  811. refresh()
  812. end -- function ScrollerMoveCallback
  813.  
  814. function ScrollerReleaseCallback(flags, hotspot_id)
  815. dragscrolling = false
  816. refresh()
  817. end -- function ScrollerReleaseCallback
  818.  
  819. function fillBuffer(rawstyles)
  820. local avail = 0
  821. local line_styles
  822. local beginning = true
  823. -- keep pulling out styles and trying to fit them on the current line
  824. local styles = copytable.deep (rawstyles)
  825. local remove = table.remove
  826. local insert = table.insert
  827. while #styles > 0 do
  828. if avail <= 0 then -- no room available? start new line
  829. -- remove first line if filled up
  830. if #lines >= MAX_LINES then
  831. remove (lines, 1)
  832. end -- if
  833. avail = WINDOW_WIDTH - (TEXT_INSET * 2) - 9
  834. line_styles = {}
  835. add_line( line_styles, beginning )
  836. beginning = false
  837. end -- line full
  838.  
  839. -- get next style, work out how long it is
  840. local style = remove (styles, 1)
  841. local width = WindowTextWidth (Win, "bodyfont"..Win, style.text)
  842.  
  843. -- if it fits, copy whole style in
  844. if width <= avail then
  845. insert (line_styles, style)
  846. avail = avail - width
  847. else -- otherwise, have to split style
  848. -- look for trailing space (work backwards). remember where space is
  849. local col = style.length - 1
  850. local split_col
  851. -- keep going until out of columns
  852. while col > 1 do
  853. width = WindowTextWidth (Win, "bodyfont"..Win, style.text:sub (1, col))
  854. if width <= avail then
  855. if not split_col then
  856. split_col = col -- in case no space found, this is where we can split
  857. end -- if
  858. -- see if space here
  859. if style.text:sub (col, col) == " " then
  860. split_col = col
  861. break
  862. end -- if space
  863. end -- if will now fit
  864. col = col - 1
  865. end -- while
  866.  
  867. -- if we found a place to split, use old style, and make it shorter. Also make a copy and put the rest in that
  868. if split_col then
  869. insert (line_styles, style)
  870. local style_copy = copytable.shallow (style)
  871. style.text = style.text:sub (1, split_col)
  872. style.length = split_col
  873. style_copy.text = style_copy.text:sub (split_col + 1)
  874. style_copy.length = #style_copy.text
  875. insert (styles, 1, style_copy)
  876. elseif next (line_styles) == nil then
  877. insert (line_styles, style)
  878. else
  879. insert (styles, 1, style)
  880. end -- if
  881. avail = 0 -- now we need to wrap
  882. end -- if could not fit whole thing in
  883. end -- while we still have styles over
  884. end -- function fillBuffer
  885.  
  886. -- Main capture routine
  887. function chats (name, line, wildcards, styles)
  888.  
  889. -- echo in this world as well if the user wants
  890. if echo then
  891. for _, v in ipairs (styles) do
  892. ColourTell (RGBColourToName (v.textcolour),RGBColourToName (v.backcolour),v.text)
  893. end -- for each style run
  894. Note ("") -- wrap up line
  895. end -- echo wanted
  896.  
  897. -- inject timestamp if wanted
  898. if timestamp then
  899. local tstamp = os.date (date_format)
  900. table.insert (styles, 1, {
  901. text = tstamp,
  902. textcolour = ColourNameToRGB (TIMESTAMP_TEXT_COLOUR),
  903. backcolour = ColourNameToRGB (TIMESTAMP_BACK_COLOUR),
  904. length = string.len (tstamp),
  905. style = 0,
  906. } )
  907. end -- if
  908.  
  909. -- store the raw lines for use during resizing
  910. if #rawlines >= MAX_LINES then
  911. table.remove(rawlines, 1)
  912. end
  913. table.insert(rawlines, styles)
  914.  
  915. fillBuffer(styles)
  916. refresh( )
  917. end -- function chats
  918.  
  919. function add_line ( line, is_beginning_of_message )
  920. -- add new line
  921. table.insert (lines, {line, false} )
  922. lines[#lines][2] = is_beginning_of_message
  923.  
  924. -- advance the count
  925. if #lines >= WINDOW_LINES then
  926. lineStart = lineStart + 1
  927. end -- if
  928.  
  929. if #lines > 1 then
  930. lineEnd = lineEnd + 1
  931. end -- if
  932. end -- function add_line
  933.  
  934. keepscrolling = false
  935. require "wait"
  936.  
  937. function scrollbar(calledBy)
  938. wait.make (function()
  939. while keepscrolling == true do
  940. if calledBy == "up" then
  941. if (lineStart > 1) then
  942. lineStart = lineStart - 1
  943. lineEnd = lineEnd - 1
  944. WindowRectOp(Win, miniwin.rect_draw_edge, (WINDOW_WIDTH-SCROLL_BAR_WIDTH), theme.TITLE_HEIGHT, 0, theme.TITLE_HEIGHT+SCROLL_BAR_WIDTH,
  945. miniwin.rect_edge_sunken, miniwin.rect_edge_at_all + miniwin.rect_option_fill_middle) -- up arrow pushed
  946. points = string.format ("%i,%i,%i,%i,%i,%i", (WINDOW_WIDTH-SCROLL_BAR_WIDTH)+3, theme.TITLE_HEIGHT+9,(WINDOW_WIDTH-SCROLL_BAR_WIDTH)+7, theme.TITLE_HEIGHT+5,(WINDOW_WIDTH-SCROLL_BAR_WIDTH)+11, theme.TITLE_HEIGHT+9)
  947. WindowPolygon (Win, points,
  948. theme.DETAIL, miniwin.pen_solid, 1, -- pen (solid, width 1)
  949. theme.DETAIL, miniwin.brush_solid, -- brush (solid)
  950. true, -- close
  951. false) -- alt fill
  952. else
  953. keepscrolling = false
  954. end
  955. elseif calledBy == "down" then
  956. if (lineEnd < #lines) then
  957. lineStart = lineStart + 1
  958. lineEnd = lineEnd + 1
  959. WindowRectOp(Win, miniwin.rect_draw_edge, (WINDOW_WIDTH-SCROLL_BAR_WIDTH), WINDOW_HEIGHT-(SCROLL_BAR_WIDTH*2), 0, WINDOW_HEIGHT-SCROLL_BAR_WIDTH-1,
  960. miniwin.rect_edge_sunken, miniwin.rect_edge_at_all + miniwin.rect_option_fill_middle) -- down arrow pushed
  961. points = string.format ("%i,%i,%i,%i,%i,%i", (WINDOW_WIDTH-SCROLL_BAR_WIDTH)+3, (WINDOW_HEIGHT-SCROLL_BAR_WIDTH)-11,(WINDOW_WIDTH-SCROLL_BAR_WIDTH)+7, (WINDOW_HEIGHT-SCROLL_BAR_WIDTH)-7, (WINDOW_WIDTH-SCROLL_BAR_WIDTH)+11,(WINDOW_HEIGHT-SCROLL_BAR_WIDTH)-11) -- draw triangle in up button
  962. WindowPolygon (Win, points,
  963. theme.DETAIL, miniwin.pen_solid, 1, -- pen (solid, width 1)
  964. theme.DETAIL, miniwin.brush_solid, -- brush (solid)
  965. true, -- close
  966. false) -- alt fill
  967. else
  968. keepscrolling = false
  969. end
  970. end -- if
  971. wait.time(0.1)
  972. refresh()
  973. end -- while keepscrolling
  974. end) -- wait.make
  975. end -- function scrollbar
  976.  
  977. function GetLineText (styles)
  978. local t = {}
  979. for _, style in ipairs (styles) do
  980. table.insert (t, style.text)
  981. end -- for
  982. return table.concat (t)
  983. end -- function GetLineText
  984.  
  985. function GetAllBufferedMessages()
  986. local t = {}
  987. for _,styles in ipairs(rawlines) do
  988. table.insert (t, GetLineText (styles))
  989. end -- for
  990. SetClipboard(table.concat(t,"\r\n"))
  991. end -- function GetAllBufferedMessages
  992.  
  993. function GetBufferedMessage(xpos, ypos)
  994. windowline = math.floor(((ypos-theme.TITLE_HEIGHT)/line_height)+1)-1
  995. text = ""
  996. if (#lines > windowline) then
  997. local line = windowline+lineStart
  998. -- go to beginning of message
  999. while lines[line][2] ~= true and line > 1 do
  1000. line = line - 1
  1001. end -- while
  1002. -- first line
  1003. local styles = copytable.deep(lines[line][1])
  1004. if (line-lineStart+1 > 0) then
  1005. Display_Line (line-lineStart, styles, true)
  1006. end -- if
  1007. text = GetLineText (styles)
  1008. -- remaining lines
  1009. line = line + 1
  1010. while line <= #lines and lines[line][2] ~= true do
  1011. local styles = copytable.deep(lines[line][1])
  1012. if (line-lineStart+1 > 0 and line-lineStart < WINDOW_LINES) then
  1013. Display_Line (line-lineStart, styles, true)
  1014. end
  1015. text = text.. GetLineText (styles)
  1016. line = line + 1
  1017. end -- while
  1018. SetClipboard(text)
  1019. end -- if
  1020. Redraw()
  1021.  
  1022. end -- function GetBufferedMessage
  1023.  
  1024. function MouseOver(flags, hotspot_id)
  1025. keepscrolling = false
  1026. end -- function MouseOver
  1027.  
  1028. function CancelMouseOver(flags, hotspot_id)
  1029. keepscrolling = false
  1030. end -- function CancelMouseOver
  1031.  
  1032. function MouseDown(flags, hotspot_id)
  1033. if (hotspot_id == "resizer") then
  1034. startx, starty = WindowInfo (Win, 17), WindowInfo (Win, 18)
  1035. elseif (hotspot_id == "scroller") then
  1036. clickdelta = WindowHotspotInfo(Win, "scroller", 2)-WindowInfo (Win, 15)
  1037. dragscrolling = true
  1038. elseif (hotspot_id == "textarea" and flags == miniwin.hotspot_got_lh_mouse) then
  1039. GetBufferedMessage(WindowInfo(Win, 14), WindowInfo(Win,15))
  1040. else
  1041. keepscrolling = true
  1042. scrollbar(hotspot_id)
  1043. end -- if
  1044. end -- function MouseDown
  1045.  
  1046. function CancelMouseDown(flags, hotspot_id)
  1047. keepscrolling = false
  1048. refresh()
  1049. end -- function CancelMouseDown
  1050.  
  1051. function MouseUp(flags, hotspot_id)
  1052. if (hotspot_id == "textarea" and flags == miniwin.hotspot_got_rh_mouse) then
  1053. -- build menu for current state
  1054. right_click_menu()
  1055. else
  1056. refresh()
  1057. end -- if
  1058. keepscrolling = false
  1059. end -- function MouseUp
  1060.  
  1061. function chat_echo (name, line, wildcards)
  1062. if wildcards [1] == false then
  1063. echo = not echo -- toggle
  1064. else
  1065. echo = wildcards [1]:lower () == " on"
  1066. end -- if
  1067.  
  1068. if echo then
  1069. ColourNote ("yellow", "", "Echoing chats in main window ENABLED.")
  1070. else
  1071. ColourNote ("yellow", "", "Echoing chats in main window DISABLED.")
  1072. end -- if
  1073. end -- function chat_echo
  1074.  
  1075. function chat_show (name, line, wildcards)
  1076. WindowShow( Win, true )
  1077. ColourNote ("yellow", "", "Chats window now shown. Type 'chats hide' to hide it.")
  1078. end -- function chat_show
  1079.  
  1080. function chat_hide (name, line, wildcards)
  1081. WindowShow( Win, false )
  1082. ColourNote ("yellow", "", "Chats window now hidden. Type 'chats show' to see it again.")
  1083. end -- function chat_hide
  1084.  
  1085. -- right click menu
  1086. function right_click_menu ()
  1087. menustring ="Copy All To Clipboard|Change Font|Turn Echo "
  1088.  
  1089. if echo then
  1090. menustring = menustring .. "Off"
  1091. else
  1092. menustring = menustring .. "On"
  1093. end -- if
  1094.  
  1095. menustring = menustring.."|>Timestamp|No Timestamps|30 Aug 13:29:49|30 Aug 01:20:12PM|13:29:08|1:22:06 PM"
  1096. result = WindowMenu (Win,
  1097. WindowInfo (Win, 14), -- x position
  1098. WindowInfo (Win, 15), -- y position
  1099. menustring) -- content
  1100. if result == "Copy All To Clipboard" then
  1101. GetAllBufferedMessages()
  1102. ColourNote ("yellow", "", "All buffered messages copied to clipboard.")
  1103. elseif result == "Change Font" then
  1104. wanted_font = utils.fontpicker (BODY_FONT_NAME, BODY_FONT_SIZE) --font dialog
  1105. if wanted_font then
  1106. BODY_FONT_NAME = wanted_font.name
  1107. BODY_FONT_SIZE = wanted_font.size
  1108. SetVariable ("bodyfont", BODY_FONT_NAME)
  1109. SetVariable ("font_size", BODY_FONT_SIZE)
  1110. OnPluginInstall()
  1111. end
  1112. elseif result == "Turn Echo Off" then
  1113. echo = false
  1114. ColourNote ("yellow", "", "Echoing chats in main window DISABLED.")
  1115. elseif result == "Turn Echo On" then
  1116. echo = true
  1117. ColourNote ("yellow", "", "Echoing chats in main window ENABLED.")
  1118. elseif result == "No Timestamps" then
  1119. timestamp = false
  1120. ColourNote ("yellow", "", "Timestamps in communication window DISABLED.")
  1121. elseif result == "30 Aug 13:29:49" then
  1122. timestamp = true
  1123. date_format = "[%d %b %H:%M:%S] "
  1124. ColourNote ("yellow", "", "Timestamps in communication window ENABLED using format like '30 Aug 13:29:49'.")
  1125. elseif result == "30 Aug 01:20:12PM" then
  1126. timestamp = true
  1127. date_format = "[%d %b %I:%M:%S%p] "
  1128. ColourNote ("yellow", "", "Timestamps in communication window ENABLED using format like '30 Aug 01:20:12PM'.")
  1129. elseif result == "13:29:08" then
  1130. timestamp = true
  1131. date_format = "[%H:%M:%S] "
  1132. ColourNote ("yellow", "", "Timestamps in communication window ENABLED using format like '13:29:08'.")
  1133. elseif result == "1:22:06 PM" then
  1134. timestamp = true
  1135. date_format = "[%I:%M:%S%p] "
  1136. ColourNote ("yellow", "", "Timestamps in communication window ENABLED using format like '1:22:06 PM'.")
  1137. end -- if
  1138. end -- function right_click_menu
  1139. ]]>
  1140. </script>
  1141. </muclient>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement