Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 19th, 2010 | Syntax: C++ | Size: 10.66 KB | Hits: 62 | Expires: Never
Copy text to clipboard
  1. ;
  2. ;            ******************************
  3. ;            *  Targeter        ver 2,25  *
  4. ;            *<<>><<>><<>><<>><<>><<>><<>>*
  5. ;            *           Romek_z_Jawora   *
  6. ;            ******************************
  7. ;
  8. ;
  9. ; Targeter uzywa TargetNext do wybrania celu,
  10. ; -pomija wiekszosc NPC
  11. ; -ma mozliwosc stworzenie okienka, ktore zawiera liste ostatnich celow
  12. ; -przy otwartym okienku, mozliwosc wybierania pomiedzy ostatnimi celami
  13. ; -komunikuje informacje o celu na 3 sposoby
  14. ;
  15. ; Mozliwosc przypomnienia celu
  16. ;
  17. ; Do niektorych zmiennych nalezy wpisac #true badz #false
  18. ;------------------------------------------
  19. ;UWAGA: jezeli nie uzywasz, ktoregos z przyciskow nadaj mu jakas wartosc np: NIEUZYWAMKLAWISZA
  20. set %nastepny F4                ;wyszukiwanie celu
  21. set %nastepnymod            ;SHIFT/ALT/CTRL
  22. set %pokazcel F2                        ;oznaczanie aktualnego celu [X]
  23. set %pokazcelmod                        ;SHIFT/ALT/CTRL
  24. ;------------------------------------------
  25. set %znajomi OWZAEB_VOWI_RYNQXB_DUTQEB_BDEWGB_FSACPB_KCZNXB_RGLBMC_NDFPCB_GKQVGB_SBCVJC_LLBXEB_PVWXEB_XKPOB_WUFSKB_WSMFHB_QFETCB_HNVZDB_FULCBC_LZGT_WUFSKB_UPAGC_IJELFB_VVOYLC_ZLCADC
  26. ;------------------------------------------
  27. set %wybieracblue #true         ; jesli #false - bedzie omijac postacie blue
  28. ;------------------------------------------
  29. set %delay 100
  30. ;------------------------------------------
  31. set %setuotitle #true           ; czy ustawiac napis tytule okna (mozna latwo edytowac sposob prezentacji tekstu)
  32. set %exmsgme #true              ; czy wyswietlac informacje o celu nad nasza glowa
  33. set %exmsgcolme 58              ; kolor
  34. set %exmsgtarget #true      ; czy wyswietlac informacje o celu nad jego glowa
  35. set %exmsgcoltarget 4000        ; kolor
  36. set %sysmessage #true           ; czy wyswietlac informacje o celu w wiadomosci systemowej
  37. set %sysmsgcol 88               ; kolor
  38. ;------------------------------------------
  39. set %okienko #true              ; czy ma tworzyc okienko
  40. set %LiczbaPrzyciskow 10        ; ile ma zapamietywac celi/ile ma stworzyc przyciskow
  41. ;------------------------------------------
  42. set %typy HS_IS_AV_XU_FH_YG
  43. ;------------------------------------------
  44. ignoreitem %znajomi 2
  45. if #charid in %znajomi
  46. ignoreitem #charid 2
  47. ;gosub IgnorujZnajomych
  48. if %okienko
  49. {
  50. set #lpc 200
  51. set %cele 0
  52. menu window title Targeter
  53. menu clear
  54. menu window color $333333
  55. set %koniec 66
  56. menu window size 200 %koniec
  57. menu image create rysunek 0 0 200 800
  58. menu image create rysunek1 0 0 200 200
  59. menu image create rysunek2 32 0 100 100
  60. menu image create rysunek3 96 0 100 100
  61. menu image create rysunek4 160 0 100 100
  62. gosub rysujmozajke rysunek1
  63. gosub rysujmozajke rysunek2
  64. gosub rysujmozajke rysunek3
  65. gosub rysujmozajke rysunek4
  66. menu font bgcolor $333333
  67. menu font color $aaaaa
  68. menu font name verdana
  69. menu font size 17
  70. menu font style b
  71. menu font align center
  72. menu text tytul 45 19 Targeter
  73. set %n 0
  74. menu show
  75. set #lpc 10
  76. }
  77. set #menubutton N/A
  78. set %cel #ltargetid
  79. ;------------------------------------------
  80. repeat
  81.         onhotkey %nastepny %nastepnymod
  82.                 gosub szukaj
  83.         if %cel <> #ltargetid && #ltargetid <> YC
  84.         {
  85.                 ;if %okienko
  86.                 ;       gosub ZmianaCelu
  87.                 ;gosub wyswietl
  88.                 set %cel #ltargetid
  89.         }
  90.         onhotkey %pokazcel %pokazcelmod
  91.                 gosub pokazcel
  92.   if #menubutton <> N/A
  93.      gosub Przycisk
  94. until #false
  95.  
  96.  
  97. ;------------------------------------------
  98. sub szukaj
  99. szukaj:
  100.         onhotkey %nastepny %nastepnymod
  101.                 goto szukaj
  102.   ignoreitem reset 1
  103.   ignoreitem #charid 1
  104.         set #sysmsgcol 78
  105.         event sysmessage [Targeter]: Szukam
  106. nastepny:
  107.         finditem %typy G
  108.         if #findkind = -1
  109.         {
  110.                 set #sysmsgcol 50
  111.                 event sysmessage [Targeter]: Brak celu
  112.                 set #ltargetid YC
  113.                 if %setuotitle
  114.                 setuotitle Ultima Online - #charname ( , #shard , )
  115.                 return
  116.         }
  117.         repeat
  118.         until ( #systime - %systime ) >= %delay
  119.         event macro 26 0
  120.         set %systime #systime
  121.         for #findindex 1 #findcnt
  122.         {
  123.   if #findid = #ltargetid
  124.   goto skok
  125.   }
  126.   goto nastepny
  127.   skok:
  128.         finditem #ltargetid G
  129.         event property #ltargetid
  130.         ignoreitem #ltargetid 1
  131.   if #findtype notin %typy
  132.                 goto nastepny
  133.         if #findrep in 2_7 || ( ! %wybieracblue && #findrep = 1 )
  134.                 goto nastepny
  135.         if #findid in %znajomi || #findid = #charid
  136.                 goto nastepny
  137.         if - in #property && oszt notin %property
  138.                 goto nastepny
  139.           gosub wyswietl
  140.         if %okienko
  141.         gosub ZmianaCelu
  142.   set %imie N/A
  143. return
  144.  
  145. sub wyswietl
  146.         gosub oczyscimie
  147.         if %setuotitle
  148.                 setuotitle Ultima Online - #charname ( , #shard , ) | [Targeter]: %imie
  149.         if %exmsgme
  150.                 event exmsg #charid 3 %exmsgcolme %imie
  151.         if %exmsgtarget
  152.                 gosub pokazcel
  153.         if %sysmessage
  154.         {
  155.                 set #sysmsgcol %sysmsgcol
  156.                 event sysmessage [Targeter]: %imie
  157.         }
  158.         set %cel #ltargetid
  159. return
  160.  
  161. sub oczyscimie
  162. gosub RemoveSurname
  163. set %imie %Name
  164. return
  165.         event property #ltargetid
  166.         set %p 1
  167.         str pos #property -
  168.         if #strres > 0
  169.                 set %p #strres + 2
  170.         str pos #property $
  171.         set %k #strres
  172.         str pos #property (
  173.         if #strres <> 0 && #strres < %k
  174.                 set %k #strres
  175.         str pos #property [
  176.         if #strres <> 0 && #strres < %k
  177.                 set %k #strres
  178.         set %k %k - %p
  179.         str mid #property %p %k
  180.         set %imie #strres
  181. return
  182.  
  183. sub pokazcel
  184. pokazcel:
  185.        onhotkey %pokazcel %pokazcelmod
  186.                 goto pokazcel
  187.         fintitem #ltargetid G_16
  188.         if #findkind <> -1
  189.         event ExMsg #ltargetid 3 %exmsgcoltarget [-> \/ <-]
  190. return
  191.  
  192.  
  193. sub rysujmozajke
  194. for %i 0 14
  195. menu Image PixLine %1 0 %i ffffffffffffffffffffffffffffffffffffffffffff
  196. for %i 17 31
  197. menu Image PixLine %1 0 %i iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
  198. for %i 34 49
  199. menu Image PixLine %1 0 %i kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
  200. for %i 52 66
  201. menu Image PixLine %1 0 %i jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
  202. for %i 0 14
  203. menu Image PixLine %1 16 %i hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
  204. for %i 17 31
  205. menu Image PixLine %1 16 %i hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
  206. for %i 34 49
  207. menu Image PixLine %1 16 %i llllllllllllllllllllllllllllllllllllllllllll
  208. for %i 52 66
  209. menu Image PixLine %1 16 %i hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
  210. for %i 0 14
  211. menu Image PixLine %1 32 %i kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
  212. for %i 17 31
  213. menu Image PixLine %1 32 %i gggggggggggggggggggggggggggggggggggggggggggg
  214. for %i 34 49
  215. menu Image PixLine %1 32 %i kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
  216. for %i 52 66
  217. menu Image PixLine %1 32 %i jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
  218. for %i 0 14
  219. menu Image PixLine %1 48 %i hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
  220. for %i 17 31
  221. menu Image PixLine %1 48 %i hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
  222. for %i 34 49
  223. menu Image PixLine %1 48 %i iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
  224. for %i 52 66
  225. menu Image PixLine %1 48 %i kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
  226. return
  227.  
  228. sub DodajButton
  229. menu font bgcolor $333333
  230. menu font color $aaaaa
  231. if %cele = 1
  232. {
  233. menu font bgcolor $aaaaa
  234. menu font color $333333
  235. }
  236. menu font size 8
  237. menu font style b
  238. menu font align center
  239. set %wys 43 + %cele * 23
  240. set %nazwa target , %cele
  241. menu Button %nazwa 0 %wys 200 23
  242. set %koniec %koniec + 23
  243. menu window size 200 %koniec
  244. return
  245.  
  246. sub Przycisk
  247. if ! %okienko
  248. return
  249. if #menubutton = CLOSED
  250. set %okienko #false
  251. str del #menubutton 1 6
  252. set %ktory #strres
  253. set #menubutton N/A
  254. if %ktory = 1 && #ltargetid = %temp1
  255. {
  256. set #sysmsgcol 50
  257. event sysmessage [Targeter]: To jest aktualny target
  258. gosub pokazcel
  259. return
  260. }
  261. set #lpc 40
  262. set %temp1 %tab . %ktory
  263. set %temp2 %tabimiona . %ktory
  264. gosub PrzesunListe 2 %ktory
  265. set %tabimiona1 %temp2
  266. set %tab1 %temp1
  267. menu set Target1 %tabimiona1
  268. set #ltargetid %tab1
  269. gosub wyswietl
  270. set #lpc 10
  271. return
  272.  
  273. sub ZmianaCelu
  274. if %tab1 = #ltargetid
  275. return
  276. if %imie = N/A
  277. gosub oczyscimie
  278. set #lpc 40
  279. for %i 2 %cele
  280. {
  281. if #ltargetid = %tab . %i
  282. {
  283. set %temp1 %tab . %i
  284. set %temp2 %tabimiona . %i
  285. gosub PrzesunListe 2 %i
  286. set %tabimiona1 %temp2
  287. set %tab1 %temp1
  288. menu set Target1 %tabimiona1
  289. set %imie N/A
  290. return
  291. }
  292. }
  293. if %cele < %LiczbaPrzyciskow
  294. {
  295. set %cele %cele + 1
  296. gosub DodajButton
  297. }
  298. if %cele > 1
  299. gosub PrzesunListe 2 %cele
  300. set %tabimiona1 %imie
  301. set %tab1 #ltargetid
  302. menu set Target1 %tabimiona1
  303. set %imie N/A
  304. set #lpc 10
  305. return
  306.  
  307. sub PrzesunListe
  308.    for %i %2 %1
  309.    {
  310.    set %j %i - 1
  311.    set %tabimiona . %i %tabimiona . %j
  312.    set %tab . %i %tab . %j
  313.    menu set Target , %i %tabimiona . %i
  314.    }
  315. return
  316.  
  317. sub IgnorujZnajomych
  318.   str count %znajomi _
  319.   set %ile #strres
  320.   set %idp 1
  321.   if %ile > 0
  322.   {
  323.      for %i 1 %ile
  324.      {
  325.        str pos %znajomi _ %i
  326.        set %idk #strres - %idp
  327.        str mid %znajomi %idp %idk
  328.        ignoreitem #strres 2
  329.        set %idp %idp + %idk + 1
  330.      }
  331.   }
  332.   str mid %znajomi %idp 100
  333.   ignoreitem #strres 2
  334. return
  335.  
  336. sub RemoveSurname
  337. event property #ltargetid
  338. set %Name #property
  339. set #lpc 300
  340.   str Count %Name #spc , #spc
  341.   if #strres > 0
  342.   {
  343.     set %DspcCnt #strres
  344.     str Pos %Name #spc , #spc %DspcCnt
  345.     set %x #strres
  346.     str Len %Name
  347.     set %dl #strres - %x + 1
  348.     str Del %Name %x %dl
  349.     set %Name #strres
  350.   }
  351.   str Pos %Name (
  352.   if #strres = 0
  353.   {
  354.     str Pos %Name $
  355.     if #strres > 0
  356.     {
  357.       str Del %Name #strres 1
  358.       set %Name #strres
  359.     }
  360.   }
  361.   else
  362.   {
  363.     set %x #strres - 1
  364.     str Len %Name
  365.     set %dl #strres - %x + 1
  366.     str Del %Name %x %dl
  367.     set %Name #strres
  368.   }
  369.   str Count %Name #spc
  370.   if #strres = 0
  371.     return
  372.   for %i 1 #strres
  373.   {
  374.     str Pos %Name #spc 1
  375.     set %dlugosc #strres - 1
  376.     str Mid %Name 1 %dlugosc
  377.     if %i = 1
  378.     {
  379.       set %str #strres
  380.       str Len %str
  381.       str Del %str #strres 1
  382.     }
  383.     set %str _ , #strres , _
  384.     if %str in _Wyjet_spod_Prawa_Lotrowsk_Lajdack_Nieprzyjemn_Porywcz_Porzadn_Uprzejm_Dobr_Uczciw_Godn_Zaufania_Odrazajac_Podl_Wredn_Niehonorow_Niecn_Wyrozniajac_sie_Przyzwoit_Honorow_Powazan_Zacn_Niegodziw_Okrutn_Haniebn_Pogardy_Glosn_Szanowan_Szacunku_Podziwu_Znan_Wielk_Przerazajac_Zl_Nikczemn_Zlowrog_Nieslawn_Znamienit_Oslawion_Szlachetn_Wybitn_Wspanial_Mroczn_Pozbawion_Honoru_Sir_Dama_Lord_Lady_
  385.     {
  386.       set %dlugosc %dlugosc + 1
  387.       str Del %Name 1 %dlugosc
  388.       set %Name #strres
  389.     }
  390.     else
  391.       break
  392.   }
  393.   str Left %Name 1
  394.   if #strres = #spc
  395.   {
  396.     str Del %Name 1 1
  397.     set %Name #strres
  398.   }
  399.   str Pos %Name #spc , - , #spc , Oszust
  400.   if #strres > 0
  401.   {
  402.     set %x #strres
  403.     str Len %Name
  404.     set %dl #strres - %x + 1
  405.     str Del %Name %x %dl
  406.     set %Name #strres
  407.   }
  408.   if Sir in %Name
  409.   {
  410.   str del %Name 1 3
  411.   set %Name #strres
  412.   }
  413.   if Dama in %Name || Lady in %Name || Lord in %Name
  414.   {
  415.   str del %Name 1 4
  416.   set %Name #strres
  417.   }
  418.   str count %Name #spc
  419.   if #strres > 0
  420.   {
  421.     str pos %Name #spc #strres
  422.     set %x #strres - 1
  423.     str left %Name 1 %x
  424.     set %Name #strres
  425.   }
  426. set #lpc 10
  427. return