Guest User

harvrepeat.lua

a guest
Nov 21st, 2016
2,369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.60 KB | None | 0 0
  1. --[[
  2. MGRemix (Miracle Grow Remix) version 2.30
  3. by Irinia of Volkmar
  4. MGRemix puts all the functionality of the cultivation interface into a small
  5. window. Also added are quick item selection and one-click repeat
  6.  
  7. This file contains code related to harvesting and repeating
  8. --]]
  9.  
  10. local mg=MiracleGrow2
  11.  
  12. --Keep track of time passed here. Time is in seconds
  13. mg.nTime=0
  14.  
  15. --Whether or not we are auto filling do to a repeat command
  16. mg.abAuto={false,false,false,false}
  17.  
  18. --When we entered the repeat state, if we are waiting to start (from mg.nTime)
  19. --Last repeat tick, if we are in progress
  20. mg.atRepeat={0,0,0,0}
  21.  
  22. --Tick system to account for lag in delays
  23. mg.tLastTick=0
  24. mg.nTickCount=0
  25.  
  26. --Number of ticks we've been repeating
  27. mg.aiRepeatTicks={0,0,0,0}
  28.  
  29. --Are we out of state 4? Updated in the on change handler so our onupdate handler is quicker
  30. mg.abRepeatGo={false,false,false,false}
  31.  
  32. --Keep of the last thing grown in each plot, in case we want to grow it again
  33. mg.aiLastGrow={
  34. [1]={0,0,0,0},
  35. [2]={0,0,0,0},
  36. [3]={0,0,0,0},
  37. [4]={0,0,0,0},
  38. }
  39. mg.asLastGrowName={
  40. [1]={L"",L"",L"",L""},
  41. [2]={L"",L"",L"",L""},
  42. [3]={L"",L"",L"",L""},
  43. [4]={L"",L"",L"",L""},
  44. }
  45.  
  46. --List of items we are refining and number of ticks untill we can retry
  47. mg.aiRefining={}
  48. mg.aLastStage={255,255,255,255}
  49.  
  50. local function c(sString)
  51. EA_ChatWindow.Print(towstring(sString),SystemData.ChatLogFilters.CRAFTING)
  52. end
  53.  
  54. --This function determines how many of uniqueID are available, taking into account items scheduled to be placed.
  55. -- It's possible to return a negative value
  56. function mg.GetItemCount(uniqueID)
  57. local vBagItems=DataUtils.GetItems();
  58. local iCount=0
  59. --Count items in our bag
  60. for k,v in pairs(vBagItems) do
  61. if v.uniqueID==uniqueID then
  62. iCount=iCount+v.stackCount
  63. end
  64. end
  65. if mg.TYPE_CRAFTING then
  66. vBagItems=DataUtils.GetCraftingItems()
  67. for k,v in pairs(vBagItems) do
  68. if v.uniqueID==uniqueID then
  69. iCount=iCount+v.stackCount
  70. end
  71. end
  72. end
  73. --Subtract items scheduled
  74. for i=1,4 do
  75. if mg.abAuto[i] then
  76. for j=1,4 do
  77. if mg.aiLastGrow[i][j]==uniqueID then
  78. iCount=iCount-1
  79. end
  80. end
  81. end
  82. end
  83. return iCount
  84. end
  85.  
  86. --This function manages the repeat list (automaticly)
  87. local function SaveContents(iPlot,vPlot)
  88. if vPlot.StageNum==4 then
  89. mg.aiLastGrow[iPlot][1]=vPlot.Seed.uniqueID
  90. mg.aiLastGrow[iPlot][2]=vPlot.Additives[2].uniqueID
  91. mg.aiLastGrow[iPlot][3]=vPlot.Additives[3].uniqueID
  92. mg.aiLastGrow[iPlot][4]=vPlot.Additives[4].uniqueID
  93. mg.asLastGrowName[iPlot][1]=vPlot.Seed.name
  94. mg.asLastGrowName[iPlot][2]=vPlot.Additives[2].name
  95. mg.asLastGrowName[iPlot][3]=vPlot.Additives[3].name
  96. mg.asLastGrowName[iPlot][4]=vPlot.Additives[4].name
  97. for i=1,4 do
  98. if mg.asLastGrowName[iPlot][i]==L"" then
  99. mg.asLastGrowName[iPlot][i]=mg.GetPhrase("tooltips","nothing")
  100. end
  101. end
  102. elseif (vPlot.StageNum>0) and (vPlot.StageNum~=255) then
  103. mg.aiLastGrow[iPlot][1]=0
  104. end
  105. end
  106.  
  107. --This function places ingredients in slots for the repeat functionality
  108. local function DoRepeat(id)
  109. local cul = GetCultivationInfo(id);
  110. if cul.StageNum==0 or cul.StageNum == 255 then
  111. nSlot,nLoc,vItem=mg.GetSlotByItemId(mg.aiLastGrow[id][1])
  112. AddCraftingItem( 3, id, nSlot, nLoc )
  113. mg.aiLastGrow[id][1]=0
  114. elseif cul.StageNum==1 and cul.Additives[2].uniqueID==0 and mg.aiLastGrow[id][2] ~= 0 then
  115. nSlot,nLoc,vItem=mg.GetSlotByItemId(mg.aiLastGrow[id][2])
  116. AddCraftingItem( 3, id, nSlot, nLoc )
  117. mg.aiLastGrow[id][2]=0
  118. elseif cul.StageNum==2 and cul.Additives[3].uniqueID==0 and mg.aiLastGrow[id][3] ~= 0 then
  119. nSlot,nLoc,vItem=mg.GetSlotByItemId(mg.aiLastGrow[id][3])
  120. AddCraftingItem( 3, id, nSlot, nLoc )
  121. mg.aiLastGrow[id][3]=0
  122. elseif cul.StageNum==3 and cul.Additives[4].uniqueID==0 and mg.aiLastGrow[id][4] ~= 0 then
  123. nSlot,nLoc,vItem=mg.GetSlotByItemId(mg.aiLastGrow[id][4])
  124. AddCraftingItem( 3, id, nSlot, nLoc )
  125. mg.aiLastGrow[id][4]=0
  126. elseif cul.StageNum == 4 then
  127. end
  128. end
  129.  
  130. --This function determines if repeat is available
  131. function mg.CanRepeat(iPlot)
  132. --Prevent disabling ourselves as we start. If we're already repeating, we can repeat.
  133. if mg.abAuto[iPlot] then
  134. return true
  135. end
  136. if mg.aiLastGrow[iPlot][1]==0 then
  137. return false
  138. end
  139. local vInfo=GetCultivationInfo(iPlot)
  140. for k,v in pairs(mg.aiLastGrow[iPlot]) do
  141. if v~=0 and mg.GetItemCount(v)<1 then
  142. --The rare seeds don't go away; we can repeat one if it's in the seed slot
  143. if (vInfo.Seed.uniqueID~=v) or (vInfo.Seed.rarity~=SystemData.ItemRarity.RARE) then
  144. return false
  145. end
  146. end
  147. end
  148. return true
  149. end
  150.  
  151. --This function takes care of all the setup when starting a repeat
  152. local function StartRepeat(iPlot)
  153. mg.abAuto[iPlot]=true
  154. mg.atRepeat[iPlot]=mg.nTime
  155. mg.aiRepeatTicks[iPlot]=0
  156. end
  157.  
  158. --If CIT is installed, do safety stocking
  159. function mg.SafetyStock(seedID)
  160. --Are we safety stocking?
  161. if (not mg.bCIT) or (not mg.vSettings.reserve) then
  162. -- d("Not enabled")
  163. return
  164. end
  165. --Are we already refining for this?
  166. if mg.aiRefining[seedID] then
  167. -- d("Already refining for "..seedID)
  168. return
  169. end
  170. --Do we need more seeds?
  171. local nShort=mg.vSettings.seedreserve-mg.GetItemCount(seedID)
  172. if nShort<1 then
  173. -- d("Already have enough "..seedID)
  174. return
  175. else
  176. --d("Short "..nShort)
  177. end
  178. --Do we know the plant for this seed?
  179. local aSeedInfo=CraftValueTip.SeedList[seedID]
  180. --d(aSeedInfo)
  181. if (not aSeedInfo) or (aSeedInfo[1]~="std") or (aSeedInfo[4]==0) then
  182. -- d("Don't know how to make more "..seedID)
  183. return
  184. end
  185. local plantID=aSeedInfo[4]
  186. --Do we have any plant and is it refinable?
  187. -- d("SafetyStock "..seedID.."="..plantID)
  188. local nSlot,nLoc,vItem=mg.GetSlotByItemId(plantID)
  189. if (nSlot==0) or (not vItem) or (not vItem.isRefinable) then
  190. -- d("Don't have mats to refine for "..seedID)
  191. return
  192. end
  193. --We have refinable plant. Refine it
  194. local nNumPlants=mg.GetItemCount(plantID)
  195. if nNumPlants<nShort then
  196. mg.aiRefining[seedID]={200,mg.vSettings.seedreserve-nShort+nNumPlants}
  197. else
  198. mg.aiRefining[seedID]={200,mg.vSettings.seedreserve}
  199. end
  200. mg.RefineItem(plantID,nShort)
  201. end
  202.  
  203. --Reduce the requirement to refine again by one
  204. function mg.EatReserve(seedID)
  205. -- d("EatReserve "..seedID)
  206. if mg.aiRefining[seedID] then
  207. mg.aiRefining[seedID][2]=mg.aiRefining[seedID][2]-1
  208. if mg.aiRefining[seedID][2]<1 then
  209. mg.aiRefining[seedID]=nil
  210. end
  211. end
  212. end
  213.  
  214. --Initialize
  215. function mg.HRInit()
  216. --Create our tooltip window
  217. CreateWindow(mg.sWindowName.."RepeatTip",false)
  218. mg.HRSetLang()
  219.  
  220. --Setup the harvest buttons
  221. WindowSetGameActionData(mg.sWindowName.."Plant1Harvest",GameData.PlayerActions.PERFORM_CRAFTING,GameData.TradeSkills.CULTIVATION,L"")
  222. WindowSetGameActionData(mg.sWindowName.."Plant2Harvest",GameData.PlayerActions.PERFORM_CRAFTING,GameData.TradeSkills.CULTIVATION,L"")
  223. WindowSetGameActionData(mg.sWindowName.."Plant3Harvest",GameData.PlayerActions.PERFORM_CRAFTING,GameData.TradeSkills.CULTIVATION,L"")
  224. WindowSetGameActionData(mg.sWindowName.."Plant4Harvest",GameData.PlayerActions.PERFORM_CRAFTING,GameData.TradeSkills.CULTIVATION,L"")
  225. end
  226.  
  227. function mg.HRSetLang()
  228. if DoesWindowExist(mg.sWindowName.."RepeatTip") then
  229. LabelSetText(mg.sWindowName.."RepeatTipTitle",mg.GetPhrase("tooltips","repeattitle"))
  230. LabelSetText(mg.sWindowName.."RepeatTipSeedTitle",mg.GetPhrase("tooltips","repeatseed"))
  231. LabelSetText(mg.sWindowName.."RepeatTipSoilTitle",mg.GetPhrase("tooltips","repeatsoil"))
  232. LabelSetText(mg.sWindowName.."RepeatTipWaterTitle",mg.GetPhrase("tooltips","repeatwater"))
  233. LabelSetText(mg.sWindowName.."RepeatTipNutTitle",mg.GetPhrase("tooltips","repeatnut"))
  234. end
  235. end
  236.  
  237. --Script command to repeat
  238. function mg.Repeat(id)
  239. local bFull=true
  240. local vInfo=GetCultivationInfo(id)
  241. if vInfo.StageNum~=0 then
  242. return
  243. end
  244. if not mg.CanRepeat(id) then
  245. return
  246. end
  247. StartRepeat(id)
  248. end
  249.  
  250. --This function is called each tick
  251. function mg.HRUpdate(nTimeElapsed)
  252. --Keep our timebase
  253. mg.nTime=mg.nTime+nTimeElapsed
  254.  
  255. --Cancel repeat if mouse is over the Default harvest button
  256. if SystemData.MouseOverWindow.name == CultivationWindow.windowName.."Harvest" then
  257. mg.abAuto[GameData.Player.Cultivation.CurrentPlot]=false
  258. mg.ForceUpdate()
  259. end
  260.  
  261. --Is this a new tick?
  262. if (mg.nTime-mg.tLastTick)>=0.10 then
  263. mg.nTickCount=mg.nTickCount+1
  264. mg.tLastTick=mg.nTime
  265. mg.OnTick()
  266. end
  267. end
  268.  
  269. --Ticks happen no more frequently than every .1 seconds
  270. function mg.OnTick()
  271. --Process auto-repeat stuff
  272. for i=1,4 do
  273. --if this plot isn't in auto, we don't care
  274. if mg.abAuto[i] then
  275. --If we've been in auto mode in stage 4 for 5 seconds, cancel auto
  276. if (not mg.abRepeatGo[i]) and ((mg.nTime-mg.atRepeat[i])>=5) then
  277. mg.abAuto[i]=false
  278. mg.ForceUpdate()
  279. end
  280. if mg.abRepeatGo[i] then
  281. if mg.aiRepeatTicks[i]==0 then
  282. --We're good to go, but haven't started
  283. DoRepeat(i)
  284. mg.aiRepeatTicks[i]=1
  285. mg.atRepeat[i]=mg.nTime
  286. else
  287. --We're in-process
  288. mg.aiRepeatTicks[i]=mg.aiRepeatTicks[i]+1
  289. if math.fmod(mg.aiRepeatTicks[i],15)==0 then
  290. DoRepeat(i)
  291. end
  292. end
  293. end
  294. end
  295. end
  296. --Process refining
  297. local __,nOverflowCount=GetOverflowData()
  298. for k,v in pairs(mg.aiRefining) do
  299. --d("Refine "..k.." "..v[1])
  300. if nOverflowCount>0 then
  301. --backpack is overflowing; we're not going to get our seeds
  302. -- d("overflow")
  303. mg.aiRefining[k]=nil
  304. elseif mg.GetItemCount(k)>=v[2] then
  305. --We have our seeds, cancel
  306. -- d("die")
  307. mg.aiRefining[k]=nil
  308. else
  309. mg.aiRefining[k][1]=mg.aiRefining[k][1]-1
  310. if mg.aiRefining[k][1]<=0 then
  311. mg.aiRefining[k]=nil
  312. mg.SafetyStock(k)
  313. end
  314. end
  315. end
  316. end
  317.  
  318. local function StageChange(i,vPlot)
  319. local iStageNum=vPlot.StageNum
  320. if (iStageNum~=255) and (mg.aLastStage[i]~=iStageNum) then
  321. if mg.aLastStage[i]==255 then
  322. mg.aLastStage[i]=iStageNum
  323. return
  324. end
  325. -- d("Change "..i.." "..mg.aLastStage[i]..">"..iStageNum)
  326. mg.aLastStage[i]=iStageNum
  327.  
  328. --Do safety stocks
  329. if (iStageNum==0) and (mg.aiLastGrow[i][1]~=0) then
  330. --Stock after harvest
  331. -- d("Harvest "..i)
  332. mg.SafetyStock(mg.aiLastGrow[i][1])
  333. elseif iStageNum==1 then
  334. --Stock after plant
  335. -- d("Plant "..i)
  336. mg.EatReserve(vPlot.Seed.uniqueID)
  337. mg.SafetyStock(vPlot.Seed.uniqueID)
  338. end
  339. end
  340. end
  341.  
  342. --This function is called when something changes
  343. function mg.HRUpdatePlot(i,vPlot)
  344. local sBaseName=mg.sWindowName.."Plant"..i
  345. local iStageNum=vPlot.StageNum
  346. mg.abRepeatGo[i]=iStageNum~=4
  347. SaveContents(i,vPlot)
  348. StageChange(i,vPlot)
  349.  
  350. if iStageNum>4 then
  351. WindowSetShowing(sBaseName.."Harvest",false)
  352. WindowSetShowing(sBaseName.."HarvestRepeat",false)
  353. WindowSetShowing(sBaseName.."Repeat",false)
  354. elseif iStageNum==4 then
  355. WindowSetShowing(sBaseName.."Harvest",true)
  356. WindowSetShowing(sBaseName.."HarvestRepeat",true)
  357. WindowSetShowing(sBaseName.."Repeat",false)
  358. if mg.CanRepeat(i) then
  359. WindowSetTintColor(sBaseName.."HarvestRepeat",DefaultColor.ZERO_TINT.r,DefaultColor.ZERO_TINT.g,DefaultColor.ZERO_TINT.b)
  360. WindowSetGameActionData(sBaseName.."HarvestRepeat",GameData.PlayerActions.PERFORM_CRAFTING,GameData.TradeSkills.CULTIVATION,L"")
  361. else
  362. WindowSetTintColor(sBaseName.."HarvestRepeat",DefaultColor.RED.r,DefaultColor.RED.g,DefaultColor.RED.b)
  363. WindowSetGameActionData(sBaseName.."HarvestRepeat",0,0,L"")
  364. end
  365. elseif iStageNum==0 then
  366. WindowSetShowing(sBaseName.."Harvest",false)
  367. WindowSetShowing(sBaseName.."HarvestRepeat",false)
  368. if mg.aiLastGrow[i][1]~=0 then
  369. WindowSetShowing(sBaseName.."Repeat",true)
  370. else
  371. WindowSetShowing(sBaseName.."Repeat",false)
  372. end
  373. if mg.CanRepeat(i) then
  374. WindowSetTintColor(sBaseName.."Repeat",DefaultColor.ZERO_TINT.r,DefaultColor.ZERO_TINT.g,DefaultColor.ZERO_TINT.b)
  375. else
  376. WindowSetTintColor(sBaseName.."Repeat",DefaultColor.RED.r,DefaultColor.RED.g,DefaultColor.RED.b)
  377. end
  378. else
  379. WindowSetShowing(sBaseName.."Harvest",false)
  380. WindowSetShowing(sBaseName.."HarvestRepeat",false)
  381. WindowSetShowing(sBaseName.."Repeat",false)
  382. end
  383. --[[
  384. if (iStageNum<2) and mg.abAuto[i] then
  385. --d("auto"..i)
  386. DoRepeat(i)
  387. end
  388. --]]
  389. end
  390.  
  391.  
  392. --------------------------
  393. -- Events
  394. --------------------------
  395.  
  396. function mg.onHHover()
  397. local sWin=SystemData.ActiveWindow.name
  398. local id=WindowGetId(WindowGetParent(sWin))
  399. if WindowGetId(sWin)==2 then
  400. mg.onHoverRepeat()
  401. else
  402. Tooltips.CreateTextOnlyTooltip(SystemData.ActiveWindow.name,mg.GetPhrase("tooltips","harvest"))
  403. Tooltips.AnchorTooltip(Tooltips.ANCHOR_WINDOW_VARIABLE)
  404. end
  405. end
  406.  
  407. function mg.onHClick()
  408. local sWin=SystemData.ActiveWindow.name
  409. local id=WindowGetId(WindowGetParent(sWin))
  410. Tooltips.ClearTooltip()
  411. --d("Click "..id)
  412. --Change plot to the one clicked so the harvest action harvests the correct plot
  413. GameData.Player.Cultivation.CurrentPlot=id
  414. CultivationWindow.UpdateAllPlots()
  415. if (WindowGetId(sWin)==2) and mg.CanRepeat(id) then
  416. --d("HAuto "..id)
  417. StartRepeat(id)
  418. else
  419. --d("over "..sWin)
  420. mg.abAuto[id]=false
  421. end
  422. mg.ForceUpdate() --Force an update so that repeat buttons can be disabled
  423. end
  424.  
  425. function mg.onHoverRepeat()
  426. local name = SystemData.MouseOverWindow.name
  427. local id = WindowGetId(WindowGetParent(name))
  428. local nSWidth,nSHeight
  429. local nWLocX,nWLocY
  430. local nScale
  431. local nCount
  432. local vAnchor={
  433. Point="topright",
  434. RelativeTo=mg.sWindowName,
  435. RelativePoint="topleft",
  436. XOffset=0,
  437. YOffset=0
  438. }
  439. if mg.aiLastGrow[id][1]~=0 then
  440. LabelSetText(mg.sWindowName.."RepeatTipSeed",mg.asLastGrowName[id][1])
  441. if mg.aiLastGrow[id][1]==0 then
  442. LabelSetText(mg.sWindowName.."RepeatTipSeedCount",L"")
  443. LabelSetTextColor(mg.sWindowName.."RepeatTipSeed",255,255,255)
  444. else
  445. nCount=mg.GetItemCount(mg.aiLastGrow[id][1])
  446. LabelSetText(mg.sWindowName.."RepeatTipSeedCount",towstring(nCount))
  447. if nCount>=1 then
  448. LabelSetTextColor(mg.sWindowName.."RepeatTipSeed",255,255,255)
  449. LabelSetTextColor(mg.sWindowName.."RepeatTipSeedCount",255,255,255)
  450. else
  451. LabelSetTextColor(mg.sWindowName.."RepeatTipSeed",255,0,0)
  452. LabelSetTextColor(mg.sWindowName.."RepeatTipSeedCount",255,0,0)
  453. end
  454. end
  455. LabelSetText(mg.sWindowName.."RepeatTipSoil",mg.asLastGrowName[id][2])
  456. if mg.aiLastGrow[id][2]==0 then
  457. LabelSetText(mg.sWindowName.."RepeatTipSoilCount",L"")
  458. LabelSetTextColor(mg.sWindowName.."RepeatTipSoil",255,255,255)
  459. else
  460. nCount=mg.GetItemCount(mg.aiLastGrow[id][2])
  461. LabelSetText(mg.sWindowName.."RepeatTipSoilCount",towstring(nCount))
  462. if nCount>=1 then
  463. LabelSetTextColor(mg.sWindowName.."RepeatTipSoil",255,255,255)
  464. LabelSetTextColor(mg.sWindowName.."RepeatTipSoilCount",255,255,255)
  465. else
  466. LabelSetTextColor(mg.sWindowName.."RepeatTipSoil",255,0,0)
  467. LabelSetTextColor(mg.sWindowName.."RepeatTipSoilCount",255,0,0)
  468. end
  469. end
  470. LabelSetText(mg.sWindowName.."RepeatTipWater",mg.asLastGrowName[id][3])
  471. if mg.aiLastGrow[id][3]==0 then
  472. LabelSetText(mg.sWindowName.."RepeatTipWaterCount",L"")
  473. LabelSetTextColor(mg.sWindowName.."RepeatTipWater",255,255,255)
  474. else
  475. nCount=mg.GetItemCount(mg.aiLastGrow[id][3])
  476. LabelSetText(mg.sWindowName.."RepeatTipWaterCount",towstring(nCount))
  477. if nCount>=1 then
  478. LabelSetTextColor(mg.sWindowName.."RepeatTipWater",255,255,255)
  479. LabelSetTextColor(mg.sWindowName.."RepeatTipWaterCount",255,255,255)
  480. else
  481. LabelSetTextColor(mg.sWindowName.."RepeatTipWater",255,0,0)
  482. LabelSetTextColor(mg.sWindowName.."RepeatTipWaterCount",255,0,0)
  483. end
  484. end
  485. LabelSetText(mg.sWindowName.."RepeatTipNut",mg.asLastGrowName[id][4])
  486. if mg.aiLastGrow[id][4]==0 then
  487. LabelSetText(mg.sWindowName.."RepeatTipNutCount",L"")
  488. LabelSetTextColor(mg.sWindowName.."RepeatTipNut",255,255,255)
  489. else
  490. nCount=mg.GetItemCount(mg.aiLastGrow[id][4])
  491. LabelSetText(mg.sWindowName.."RepeatTipNutCount",towstring(nCount))
  492. if nCount>=1 then
  493. LabelSetTextColor(mg.sWindowName.."RepeatTipNut",255,255,255)
  494. LabelSetTextColor(mg.sWindowName.."RepeatTipNutCount",255,255,255)
  495. else
  496. LabelSetTextColor(mg.sWindowName.."RepeatTipNut",255,0,0)
  497. LabelSetTextColor(mg.sWindowName.."RepeatTipNutCount",255,0,0)
  498. end
  499. end
  500. Tooltips.CreateCustomTooltip(name,mg.sWindowName.."RepeatTip")
  501.  
  502. --Choose the position for the tooltip
  503. nScale=InterfaceCore.GetScale()
  504. nSWidth,nSHeight=WindowGetDimensions("Root")
  505. nWLocX,nWLocY=WindowGetScreenPosition(mg.sWindowName)
  506. nWLocX=nWLocX/nScale;nWLocY=nWLocY/nScale
  507. --If we're too close to the right side, we can't use the default
  508. if (nSWidth-nWLocX)<600 then
  509. if nWLocY>200 then
  510. --Top
  511. vAnchor.RelativePoint="bottomright"
  512. else
  513. --Bottom
  514. vAnchor.Point="bottomright"
  515. vAnchor.RelativePoint="topright"
  516. end
  517. end
  518. Tooltips.AnchorTooltip(vAnchor)
  519. end
  520. end
  521.  
  522. function mg.onRepeat()
  523. local id=WindowGetId(WindowGetParent(SystemData.ActiveWindow.name))
  524. Tooltips.ClearTooltip()
  525. mg.Repeat(id)
  526. end
Advertisement
Add Comment
Please, Sign In to add comment