ScriptUO

Official ScriptUO EasyUO Scripts => Script Snippets => Topic started by: TrailMyx on December 01, 2009, 02:15:58 PM

Title: Trailmyx's Forum Item Info
Post by: TrailMyx on December 01, 2009, 02:15:58 PM
Code: easyuo
  1. ;=================================================================
  2. ; Script Name: TrailMyx's Forum Item Info
  3. ; Author: TrailMyx
  4. ; Version: 1.0
  5. ; Shard OSI / FS: OSI / FS OK
  6. ; Revision Date: 9/29/2007
  7. ; Purpose: Summarizes an item property and formats this information to be posted on a forum such as ScriptUO.
  8. ;          Known to work on an SMF-powered forum
  9. ; Globals:
  10. ;=================================================================
  11. ; Disclaimer:  By running this script, you are accepting the contents of this licence agreement.
  12. ; This script is only authorized to be distributed on www.scriptuo.com  If you purchase this script,
  13. ; acquire it from another website, it is not considered an authorized copy and should be deleted
  14. ; immediately.
  15. ; You hold the author, TrailMyx, and the distribution site www.scriptuo.com not liable for any loss of
  16. ; items, accounts, monitary or time losses associated with the use of this script.  Furthermore, you promise
  17. ; not to distribute or sell this script to anyone without the express permission of the author, Trailmyx.
  18. ; Violation of the contents of this agreement will result in one of the following: litigation, www.scriptuo.com
  19. ; account termination, discimination of bad karma for your next life, and most definitely causing a black mark
  20. ; placed on your soul.
  21. ;
  22. ; I worked very hard to bring this script to you, so please use it responisibily and
  23. ; respectfully.  If you have any questions, please reach me at trailmyx@yahoo.com.
  24. ; (c) 2007 TrailMyx, All rights reserved.
  25. ;===================================================================
  26. gosub showEUOMenu1
  27.  
  28. set #MENUBUTTON N/A
  29. set #LPC 100
  30. repeat
  31.   if #MENUBUTTON = EUOButtonTarget
  32.   {
  33.     set #TARGCURS 1
  34.     repeat
  35.     until #TARGCURS = 0
  36.     event property #LTARGETID
  37.     gosub TM_AddSpace #PROPERTY
  38.     gosub TM_SplitString #RESULT $
  39.     gosub TM_SubstringCount
  40.     set %lines #RESULT - 1
  41.     set %bbc
  42.     for %i 0 %lines
  43.     {
  44.       gosub TM_GetIndex %i
  45.       set %bbc %bbc , [li] , #RESULT , [/li]
  46.     }
  47.     menu set EUOEditBBC %bbc
  48.     set #MENUBUTTON N/A
  49.   }
  50. until #FALSE
  51. ;-------------------------------------------------------------------------------
  52. sub TM_SplitString
  53.   namespace push
  54.   namespace local PS
  55.   namespace clear
  56.   set !string %1
  57.   set !delimiter %2
  58.   set !cnt 0
  59.   str pos !string !delimiter
  60.   repeat
  61.     if #STRRES = 0
  62.       break
  63.     set !temp #STRRES - 1
  64.     str left !string !temp
  65.     set !array . !cnt #STRRES
  66.     set !cnt !cnt + 1
  67.     set !temp !temp + 1
  68.     str del !string 1 !temp
  69.     set !string #STRRES
  70.     str pos !string !delimiter
  71.   until #STRRES = 0
  72.   set #RESULT !cnt
  73.   namespace pop
  74. return #RESULT
  75. ;-------------------------------------------------------------------------------
  76. sub TM_GetIndex
  77.   namespace push
  78.   namespace local PS
  79.   set !index %1
  80.   set #RESULT !array . !index
  81.   namespace pop
  82. return #RESULT
  83. ;-------------------------------------------------------------------------------
  84. sub TM_SubstringCount
  85.   namespace push
  86.   namespace local PS
  87.   set #RESULT !cnt
  88.   namespace pop
  89. return #RESULT
  90. ;-------------------------------------------------------------------------------
  91. ; %1 - string to mung
  92. sub TM_AddSpace
  93.   namespace push
  94.   namespace local AS
  95.   set !tempstring %1
  96.   AddSpace_loop1:
  97.     str pos !tempstring _
  98.     if #STRRES <> 0
  99.     {
  100.       set !val #STRRES - 1
  101.       str left !tempstring !val
  102.       set !left #STRRES
  103.       set !val !val + 1
  104.       str del !tempstring 1 !val
  105.       set !tempstring !left , #SPC , #STRRES
  106.       goto AddSpace_loop1
  107.     }
  108.   set #RESULT !tempstring
  109.   namespace pop
  110. return #RESULT
  111.  
  112. ;--------- EasyUO Menu Designer Code Begin ---------
  113. sub showEUOMenu1
  114.         menu Clear
  115.         menu Window Title TrailMyx Item Property Poster
  116.         menu Window Color BtnFace
  117.         menu Window Size 324 50
  118.         menu Font Transparent #true
  119.         menu Font Align Right
  120.         menu Font Name MS Sans Serif
  121.         menu Font Size 8
  122.         menu Font Style
  123.         menu Font Color WindowText
  124.         menu Button EUOButtonTarget 132 4 75 25 Target
  125.         menu Font BGColor Window
  126.         menu Edit EUOEditBBC 8 32 305
  127.         menu Show 421 270
  128. return
  129. ;--------- EasyUO Menu Designer Code End ---------
  130.  

Use this bit of code when you want to get information about a specific item.  Just click the "Target" button, target the item to fill the edit box in the little UI with the item information.  You can then cut/paste (right click/copy the selected text in the edit box), then just paste it into a a forum message.

Known to work with SMF.  Not sure it'll work on PHPBB or VBulletin.

Title: Re: Trailmyx's Forum Item Info
Post by: Khameleon on December 01, 2009, 02:25:59 PM
sounds pretty cool not sure how useful it would be for me... but I'll put it in my directory :)
Title: Re: Trailmyx's Forum Item Info
Post by: TrailMyx on December 01, 2009, 02:31:08 PM
It's just a quick little thing for people to post information about an item without having to re-type it in.  I see a lot of people talking about item information, but don't post the items specific info.  This is just a quick way to do it.  You can do this from the Totalizer as well, but this little snippet lets you target an individual item.
Title: Re: Trailmyx's Forum Item Info
Post by: cgeorgemo on December 02, 2009, 02:40:43 PM
Thanks TM.
I'm all the time trying to toggle back and forth to the screen from my documents getting the stuff written down.
Title: Re: Trailmyx's Forum Item Info
Post by: onlyindreams on December 02, 2009, 02:59:39 PM
Great idea! Thanks for sharing TM!
Title: Re: Trailmyx's Forum Item Info
Post by: NObama on December 02, 2009, 03:53:29 PM
Would it be worthwhile to have it dump the itemID as well?  Seems like that's always what we want...for some benign, non-afk purpose I'm sure  ::)

 :)
Title: Re: Trailmyx's Forum Item Info
Post by: TrailMyx on December 02, 2009, 04:04:09 PM
Would it be worthwhile to have it dump the itemID as well?  Seems like that's always what we want...for some benign, non-afk purpose I'm sure  ::)

 :)

Already have a script for that:

http://www.scriptuo.com/index.php?topic=188.0