Advertisement
Guest User

LotjShipbuilding

a guest
Jul 2nd, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.28 KB | None | 0 0
  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <!DOCTYPE muclient>
  3. <!-- Saved on Saturday, July 17, 2010, 3:06 PM -->
  4. <!-- MuClient version 4.43 -->
  5.  
  6. <!-- Plugin "LotJBuildship" generated by Plugin Wizard -->
  7.  
  8. <muclient>
  9. <plugin
  10. name="LotJBuildship"
  11. author="@Ilyena"
  12. id="48dbd8f76a18f61774974d3a"
  13. language="Lua"
  14. purpose="Making ship building easier"
  15. save_state="y"
  16. date_written="2010-07-17 15:04:58"
  17. requires="4.43"
  18. version="1.0"
  19. >
  20. <description trim="y">
  21. <![CDATA[
  22. Use buildhelp to see the commands
  23. ]]>
  24. </description>
  25.  
  26. </plugin>
  27.  
  28.  
  29. <!-- Get our standard constants -->
  30.  
  31. <include name="constants.lua"/>
  32.  
  33. <!-- Triggers -->
  34.  
  35. <triggers>
  36. <trigger
  37. enabled="y"
  38. group="Shipbuilding"
  39. match="^You step away from your finished (.*)!$"
  40. name="FinishedShipMove"
  41. regexp="y"
  42. script="MoveOntoNextShip"
  43. sequence="100"
  44. >
  45. </trigger>
  46. <trigger
  47. group="Shipbuilding"
  48. match="^(.*)\[ALERT\]\: EMERGENCY COPYOVER \- Keep calm\, we might pull through\!$"
  49. name="CopyoverCoverage"
  50. regexp="y"
  51. script="BuildShip"
  52. sequence="100"
  53. >
  54. </trigger>
  55. <trigger
  56. enabled="y"
  57. group="Shipbuilding"
  58. match="You don't have a component like that."
  59. name="GetShipParts"
  60. script="GetShipParts"
  61. sequence="100"
  62. >
  63. </trigger>
  64. <trigger
  65. enabled="y"
  66. group="Shipbuilding"
  67. match="You are now afk."
  68. name="GoingAFK"
  69. send_to="12"
  70. sequence="100"
  71. >
  72. <send>EnableTimer("EnduranceMode", false)</send>
  73. </trigger>
  74. <trigger
  75. group="Antitheft"
  76. match="^ Near Me(.*) $"
  77. name="TidyUp"
  78. regexp="y"
  79. script="TidyUp"
  80. sequence="100"
  81. >
  82. </trigger>
  83. <trigger
  84. enabled="y"
  85. group="Shipbuilding"
  86. match="Where to begin? It all looks so complex..."
  87. name="BadBuildShip"
  88. script="BuildShip"
  89. sequence="100"
  90. >
  91. </trigger>
  92. <trigger
  93. group="Shipbuilding"
  94. match="^(.*) COPYOVER by (.*) \- please remain seated\!$"
  95. name="CopyoverProtection"
  96. regexp="y"
  97. script="BuildShip"
  98. sequence="100"
  99. >
  100. </trigger>
  101. <trigger
  102. group="Shipbuilding"
  103. keep_evaluating="y"
  104. match="^(.*) steps away from (.*) looking very pleased with (.*)\.$"
  105. name="SpamRemoval1"
  106. omit_from_log="y"
  107. omit_from_output="y"
  108. regexp="y"
  109. script="TidyUp"
  110. sequence="100"
  111. >
  112. </trigger>
  113. <trigger
  114. group="Shipbuilding"
  115. keep_evaluating="y"
  116. match="^(.*) takes (.*) tools and starts to work on (.*)$"
  117. name="SpamRemoval2"
  118. omit_from_log="y"
  119. omit_from_output="y"
  120. regexp="y"
  121. sequence="100"
  122. >
  123. </trigger>
  124. <trigger
  125. group="Shipbuilding"
  126. keep_evaluating="y"
  127. match="^(.*)droid assists(.*)$"
  128. name="SpamRemoval3"
  129. omit_from_log="y"
  130. omit_from_output="y"
  131. regexp="y"
  132. script="TidyUp"
  133. sequence="100"
  134. >
  135. </trigger>
  136. <trigger
  137. group="Shipbuilding"
  138. keep_evaluating="y"
  139. match="^(.*) gets (.*)$"
  140. name="SpamRemoval4"
  141. omit_from_log="y"
  142. omit_from_output="y"
  143. regexp="y"
  144. sequence="100"
  145. >
  146. </trigger>
  147. <trigger
  148. group="Shipbuilding"
  149. keep_evaluating="y"
  150. match="^You gain (.*) engineering experience\.$"
  151. name="SpamRemoval5"
  152. omit_from_log="y"
  153. omit_from_output="y"
  154. regexp="y"
  155. sequence="100"
  156. >
  157. </trigger>
  158. <trigger
  159. group="Shipbuilding"
  160. keep_evaluating="y"
  161. match="^Your droid gains (.*) experience points\.$"
  162. name="SpamRemoval6"
  163. omit_from_log="y"
  164. omit_from_output="y"
  165. regexp="y"
  166. sequence="100"
  167. >
  168. </trigger>
  169. <trigger
  170. enabled="y"
  171. group="Shipbuilding"
  172. match="You step away from G-Type Light Shuttle, and realize you've done it all wrong..."
  173. name="ErrorBuildShip"
  174. script="BuildShip"
  175. sequence="100"
  176. >
  177. </trigger>
  178. <trigger
  179. enabled="y"
  180. group="Shipbuilding"
  181. match="^Your (.*) doesnt need any more of that\.$"
  182. name="MoveOnToNextPart"
  183. regexp="y"
  184. script="MoveOntoNextPart"
  185. sequence="100"
  186. >
  187. <send>
  188. </send>
  189. </trigger>
  190. <trigger
  191. group="Shipbuilding"
  192. match="You finish modifying the ship."
  193. name="ContinueTheShip"
  194. script="BuildShip"
  195. sequence="100"
  196. >
  197. </trigger>
  198. <trigger
  199. group="Shipbuilding"
  200. match="You may now bot again."
  201. name="ShipBotting"
  202. script="ReturnFromAFK"
  203. sequence="100"
  204. >
  205. <send>afk
  206. bot start</send>
  207. </trigger>
  208. <trigger
  209. enabled="y"
  210. group="Shipbuilding"
  211. match="You don't see a ship like that nearby to work on."
  212. name="MoveToNextShip"
  213. script="MoveOntoNextShip"
  214. sequence="100"
  215. >
  216. </trigger>
  217. </triggers>
  218.  
  219. <!-- Aliases -->
  220.  
  221. <aliases>
  222. <alias
  223. name="AddShipToQueue"
  224. script="AddShipToQueue"
  225. match="buildadd *"
  226. enabled="y"
  227. group="Shipbuilding"
  228. sequence="100"
  229. >
  230. </alias>
  231. <alias
  232. name="ShowPartNames"
  233. script="ShowPartNames"
  234. match="buildshowparts"
  235. enabled="y"
  236. group="Shipbuilding"
  237. sequence="100"
  238. >
  239. </alias>
  240. <alias
  241. name="ClearBuildLost"
  242. script="ClearBuildList"
  243. match="buildclear"
  244. enabled="y"
  245. group="Shipbuilding"
  246. sequence="100"
  247. >
  248. </alias>
  249. <alias
  250. match="buildspam on"
  251. enabled="y"
  252. group="Shipbuilding"
  253. send_to="12"
  254. sequence="100"
  255. >
  256. <send>EnableTrigger("SpamRemoval1", false)
  257. EnableTrigger("SpamRemoval2", false)
  258. EnableTrigger("SpamRemoval3", false)
  259. EnableTrigger("SpamRemoval4", false)
  260. EnableTrigger("SpamRemoval5", false)
  261. EnableTrigger("SpamRemoval6", false)</send>
  262. </alias>
  263. <alias
  264. name="ShowShipQueue"
  265. script="ShowShipQueue"
  266. match="buildlist"
  267. enabled="y"
  268. group="Shipbuilding"
  269. sequence="100"
  270. >
  271. </alias>
  272. <alias
  273. name="EnduranceOff"
  274. script="DisableEndurance"
  275. match="buildendurance off"
  276. enabled="y"
  277. group="Shipbuilding"
  278. sequence="100"
  279. >
  280. </alias>
  281. <alias
  282. name="PartNames"
  283. script="SetPartName"
  284. match="^buildpartname (.*) (.*)$"
  285. enabled="y"
  286. group="Shipbuilding"
  287. regexp="y"
  288. sequence="100"
  289. >
  290. </alias>
  291. <alias
  292. match="buildspam off"
  293. enabled="y"
  294. group="Shipbuilding"
  295. send_to="12"
  296. sequence="100"
  297. >
  298. <send>EnableTrigger("SpamRemoval1", true)
  299. EnableTrigger("SpamRemoval2", true)
  300. EnableTrigger("SpamRemoval3", true)
  301. EnableTrigger("SpamRemoval4", true)
  302. EnableTrigger("SpamRemoval5", true)
  303. EnableTrigger("SpamRemoval6", true)</send>
  304. </alias>
  305. <alias
  306. name="DisplayBuildCommands"
  307. script="BuildCommandHelp"
  308. match="buildhelp"
  309. enabled="y"
  310. group="Shipbuilding"
  311. sequence="100"
  312. >
  313. </alias>
  314. <alias
  315. name="BuildShip"
  316. script="BeginBuilding"
  317. match="buildship"
  318. enabled="y"
  319. group="Shipbuilding"
  320. sequence="100"
  321. >
  322. </alias>
  323. <alias
  324. name="EnduranceOn"
  325. script="EnableEndurance"
  326. match="buildendurance on"
  327. enabled="y"
  328. group="Shipbuilding"
  329. send_to="12"
  330. sequence="100"
  331. >
  332. </alias>
  333. <alias
  334. name="BuildSkip"
  335. script="SkipPart"
  336. match="buildskip"
  337. enabled="y"
  338. group="Shipbuilding"
  339. sequence="100"
  340. >
  341. </alias>
  342. <alias
  343. name="BuildBottingOnAlias"
  344. match="buildbot on"
  345. enabled="y"
  346. group="Shipbuilding"
  347. send_to="12"
  348. sequence="100"
  349. >
  350. <send>EnableTrigger("ShipBotting", true)
  351. EnableTrigger("CopyoverCoverage", true)
  352. EnableTrigger("CopyoverProtection", true)
  353. ColourNote("green", "", "Ship Building Botting On")</send>
  354. </alias>
  355. <alias
  356. name="BuildBottingOffAlias"
  357. match="buildbot off"
  358. enabled="y"
  359. group="Shipbuilding"
  360. send_to="12"
  361. sequence="100"
  362. >
  363. <send>EnableTrigger("ShipBotting", false)
  364. EnableTrigger("CopyoverCoverage", false)
  365. EnableTrigger("CopyoverProtection", false)
  366. ColourNote("red", "", "Ship Building Botting Off")</send>
  367. </alias>
  368. </aliases>
  369.  
  370. <!-- Timers -->
  371.  
  372. <timers>
  373. <timer name="EnduranceMode" script="BuildShip" enabled="n" second="5.40" offset_second="0.00" group="Shipbuilding" >
  374.  
  375. </timer>
  376. </timers>
  377.  
  378. <!-- Variables -->
  379.  
  380. <variables>
  381. <variable name="hullpart">hull</variable>
  382. <variable name="circuitspart">circuits</variable>
  383. <variable name="enginespart">engines</variable>
  384. <variable name="weaponspart">weapons</variable>
  385. </variables>
  386.  
  387. <!-- Script -->
  388.  
  389.  
  390. <script>
  391. <![CDATA[
  392. shipParts = {"hull", "circuits", "engines", "weapons"}
  393. partNames = {GetVariable("hullpart"), GetVariable("circuitspart"), GetVariable("enginespart"), GetVariable("weaponspart")}
  394. currentPart = 1
  395. shipQueue = {}
  396. endurance = false
  397. shipName = nil
  398.  
  399. function AddShipToQueue(name, line, wildcards)
  400. if (wildcards[1] ~= nil) then
  401. if (shipQueue[1] == nil) then
  402. table.insert(shipQueue, 1, wildcards[1])
  403. Note(wildcards[1] .. " added to ship queue!")
  404. else
  405. table.insert(shipQueue, wildcards[1])
  406. Note(wildcards[1] .. " added to ship queue!")
  407. end -- if
  408. end -- if
  409. end -- function
  410.  
  411. function BeginBuilding(name, line, wildcards)
  412. for i, v in ipairs(partNames) do
  413. Send("drop all." .. partNames[i])
  414. end -- for
  415. BuildShip()
  416. end -- function
  417.  
  418. function BuildShip(name, line, wildcards)
  419.  
  420. if (shipQueue[1] ~= nil) then
  421. shipName = shipQueue[1]
  422. end -- if
  423. if (shipName ~= nil) then
  424. --for i, v in ipairs(partNames) do
  425. -- Send("drop all." .. partNames[i])
  426. --end -- for
  427. Send("buildship " .. shipName .. " " .. shipParts[currentPart])
  428. else
  429. Note("Building Finished!")
  430. end -- if
  431. end -- function
  432.  
  433. function ClearBuildList(name, line, wildcards)
  434. shipQueue = {}
  435. Note("Ship Build List Cleared!")
  436. end -- function
  437.  
  438. function DisableEndurance(name, line, wildcards)
  439. EnableTimer("EnduranceMode", false)
  440. EnableTrigger("ContinueTheShip", true)
  441. ColourNote("red", "black", "Endurance Mode Deactivated")
  442. endurance = false
  443. end -- function
  444.  
  445. function EnableEndurance(name, line, wildcards)
  446. EnableTimer("EnduranceMode", true)
  447. EnableTrigger("ContinueTheShip", false)
  448. ColourNote("green", "black", "Endurance Mode Activated")
  449. endurance = true
  450. end -- function
  451.  
  452. function GetShipParts(name, line, wildcards)
  453. Send("get 100 " .. partNames[currentPart])
  454. BuildShip()
  455. end -- function
  456.  
  457. function MoveOntoNextPart(name, line, wildcards)
  458. Send("drop all." .. partNames[currentPart])
  459. currentPart = currentPart + 1
  460. if (currentPart == 5) then
  461. currentPart = 1
  462. end -- if
  463. BuildShip()
  464. end -- function
  465.  
  466. function MoveOntoNextShip(name, line, wildcards)
  467. if (shipQueue[1] ~= nil) then
  468. table.remove(shipQueue,1)
  469. end -- if
  470. shipName = shipQueue[1]
  471. currentPart = 1
  472. BeginBuilding()
  473. end -- function
  474.  
  475. function ReturnFromAFK(name, line, wildcards)
  476. if (endurance == true) then
  477. EnableEndurance()
  478. else
  479. BuildShip()
  480. end -- if
  481. end -- function
  482.  
  483. function SetPartName(name, line, wildcards)
  484. if (wildcards[1] == "hull") then
  485. SetVariable("hullpart", wildcards[2])
  486. partNames[1] = GetVariable("hullpart")
  487. ColourNote("green","","Part type '" .. shipParts[1] .. "' coupled with '" .. partNames[1] .. "'")
  488. elseif (wildcards[1] == "circuits") then
  489. SetVariable("circuitspart", wildcards[2])
  490. partNames[2] = GetVariable("circuitspart")
  491. ColourNote("green","","Part type '" .. shipParts[2] .. "' coupled with '" .. partNames[2] .. "'")
  492. elseif (wildcards[1] == "engines") then
  493. SetVariable("enginespart", wildcards[2])
  494. partNames[3] = GetVariable("enginespart")
  495. ColourNote("green","","Part type '" .. shipParts[3] .. "' coupled with '" .. partNames[3] .. "'")
  496. elseif (wildcards[1] == "weapons") then
  497. SetVariable("weaponspart", wildcards[2])
  498. partNames[4] = GetVariable("weaponspart")
  499. ColourNote("green","","Part type '" .. shipParts[4] .. "' coupled with '" .. partNames[4] .. "'")
  500. else
  501. ColourNote("red","","Part type not found")
  502. end -- if
  503. end -- function
  504.  
  505. function ShowPartNames(name, line, wildcards)
  506. Note("Partnames are as follows")
  507. for i, v in ipairs(shipParts) do
  508. Note(shipParts[i] .. " = " .. partNames[i])
  509. end -- for
  510. end -- function
  511.  
  512. function ShowShipQueue(name, line, wildcards)
  513. Note("Ship Queue Contains: ")
  514. for i, v in ipairs(shipQueue) do
  515. Note(shipQueue[i])
  516. end -- for
  517. end -- function
  518.  
  519. function SkipPart(name, line, wildcards)
  520. Send("drop all." .. partNames[currentPart])
  521. currentPart = currentPart + 1
  522. if (currentPart > #shipParts) then
  523. currentPart = 1
  524. end -- if
  525. Note("Moving Onto Next Part: " .. shipParts[currentPart])
  526. BuildShip()
  527. end -- function
  528.  
  529. function TidyUp(name, line, wildcards)
  530. DeleteLines(1)
  531. end -- function
  532.  
  533. function BuildCommandHelp(name, list, wildcards)
  534. Note("LotJ - Shipbuilding by @Ilyena and @Anastasius")
  535. Note("buildadd #- Add a ship to the build queue")
  536. Note("buildclear - Clear the ship queue")
  537. Note("buildlist - Display the build queue")
  538. Note("buildship - Starts building the queue")
  539. Note("buildskip - Skip to next part in the list")
  540. Note("buildendurance on/off - Turn the timer setting on and off. Useful for not running out of movement on smaller ships")
  541. Note("buildpartname <buildname> <getname> - Change the name of a part name if it differs from the build name")
  542. Note("buildshowparts - Display the name relations between parts and their names")
  543. Note("buildspam on/off - Turn the build spam on or off. Off means that you don't see it")
  544. Note("buildbot on/off - Turn the build botting on or off. Will recover from AFK")
  545. end -- function
  546. ]]>
  547. </script>
  548.  
  549.  
  550. <!-- Plugin help -->
  551.  
  552. <aliases>
  553. <alias
  554. script="OnHelp"
  555. match="LotJBuildship:help"
  556. enabled="y"
  557. >
  558. </alias>
  559. </aliases>
  560.  
  561. <script>
  562. <![CDATA[
  563. function OnHelp ()
  564. world.Note (world.GetPluginInfo (world.GetPluginID (), 3))
  565. end
  566. ]]>
  567. </script>
  568.  
  569. </muclient>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement