Thread Tools Display Modes
03/14/15, 08:36 AM   #1
dopiate
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 142
Book / Bookshelf Closure during speed farming....

I'm writing a small addon and I'm having trouble doing one thing.

When you are farming and accidentally search a bookshelf or book I want to close the window automatically or hook that function so it doesn't even show up.

I am able to detect when I have a book or bookshelf open with an event.

Then I can determine that it is a book or whatever it is that I can't loot from using GetGameCameraInteractableActionInfo()

But I was looking for the best way to either stop it, block it or close it.

I was trying EndInteraction() but I am getting nowhere with that.

Does anyone have a suggestion.

This addon would be for high speed farming in places that you aren't "stealing' from.

Thanks for any assistance.

-d

Last edited by dopiate : 03/14/15 at 08:39 AM. Reason: spelling mistakes
  Reply With Quote
03/14/15, 08:57 AM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
You will need to hide interaction scene, it should be something like:
Lua Code:
  1. SCENE_MANAGER:Hide("loreReaderInteraction")

Or maybe better is showing base scene instead of just hidding interact scene, this is an action what default Exit button does:
Lua Code:
  1. SCENE_MANAGER:ShowBaseScene()


If you want to completely disable LoreReader instead of immediately hidding, you will need something like (untested):
Lua Code:
  1. local hide_lorereader = true
  2.  
  3. local function Show_Hook(self, title, body, medium, showTitle)
  4.     if hide_lorereader and SCENE_MANAGER:IsShowingBaseScene() then --disable LoreReader just for interactions, not for LoreLibrary
  5.         d(zo_strformat("Book: |cFFFFFF<<1>>|r", title))
  6.         PlaySound(SOUNDS.BOOK_OPEN)
  7.         EndInteraction(INTERACTION_BOOK)
  8.     end
  9.     return hide_lorereader
  10. end
  11.  
  12. ZO_PreHook(LORE_READER, "Show", Show_Hook)

Last edited by Garkin : 03/14/15 at 09:05 AM.
  Reply With Quote
03/14/15, 09:07 AM   #3
dopiate
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 142
Originally Posted by Garkin View Post

Or maybe better is showing base scene instead of just hidding interact scene, this is an action what default Exit button does:
Lua Code:
  1. SCENE_MANAGER:ShowBaseScene()
I think this would be better as I don't want to prevent a user from getting credit for a new lore book - while the chance is low if you are speed farming, it's still possible

Thanks for the quick response.

I will look into doing the default "alt' (close interaction) right away so I don't deprive anyone of adding a new lore book by accident.

I have my interaction key mapped to my middle wheel of my mouse so I can farm very rapidly. The only thing that slows me down is bookshelves and books so I'm trying to remove that obstacle.

-d
  Reply With Quote
03/14/15, 09:14 AM   #4
dopiate
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 142
Once again you are the man!

Just tested it - worked perfect

I'll clean up my code and make it available for others later today.

-d
  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » Book / Bookshelf Closure during speed farming....


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off