ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Reporting Bots (https://www.esoui.com/forums/showthread.php?t=7398)

Drummerx04 10/07/17 01:08 AM

Reporting Bots
 
I decided to write a bot reporting addon. The irony of automating the process of reporting automated players was too good to pass up... For the most part it works about as well as I had envisioned except for the actual bot reporting part.

The only function I was able to dig up from the wiki and the source code that wasn't just nil is
Lua Code:
  1. ZO_HELP_GENERIC_TICKET_SUBMISSION_MANAGER:OpenReportPlayerTicketScene(playerName, rawName)

This function is bound and works pretty much exactly as advertised, i.e. opens the report window with the player name filled in, but I would like to include more actionable information automatically populated within the description field (information that my addon already gathers).

I can see the abuse potential for zero interaction player reporting, but automatic population of fields (but manual submission button) would be really nice.

A promising looking function in the API section on the wiki is:
Lua Code:
  1. ZO_ReportPlayerDialog_Show(playerName, reason, rawName, optionalCallback)
But the function is nil, so no dice.

I've considered trying to find a way to detect that the description field is active, and just adding a string at the cursor... but there isn't an obvious way I can see to either detect such a thing or to place text at the current cursor location.

Any suggestions for handling the reporting window would be appreciated, thank you!

Side Note:
It is probably worth mentioning that the similar function
Lua Code:
  1. ReportFeedback(...)
is bound and does appear to automatically submit fully populated feedback without any further interaction.

Baertram 10/07/17 05:32 AM

Just a quaick & dirty idea without further checks:

ZO_HELP_GENERIC_TICKET_SUBMISSION_MANAGER:OpenReportPlayerTicketScene

The name says it's a scene? So you could check if it is really a scene, using SCENE_MANAGER to check if the activeScene is filled with something like "help_generic_ticket" or similar.
Then use your own scene's callback function for the onSceneChange function (see this thread for a scene's fragment, but pretty works the same for a scene: http://www.esoui.com/forums/showthre...ighlight=scene)
and check if the edit field fpr the description etc. is not hidden editCtrl:IsHidden().
If it's shown: Fill it with your text (something like editCtrl:SetText("hello world")

Drummerx04 10/07/17 11:51 AM

Quote:

Originally Posted by Baertram (Post 32854)
Just a quaick & dirty idea without further checks:

ZO_HELP_GENERIC_TICKET_SUBMISSION_MANAGER:OpenReportPlayerTicketScene

The name says it's a scene? So you could check if it is really a scene, using SCENE_MANAGER to check if the activeScene is filled with something like "help_generic_ticket" or similar.
Then use your own scene's callback function for the onSceneChange function (see this thread for a scene's fragment, but pretty works the same for a scene: http://www.esoui.com/forums/showthre...ighlight=scene)
and check if the edit field fpr the description etc. is not hidden editCtrl:IsHidden().
If it's shown: Fill it with your text (something like editCtrl:SetText("hello world")

Hmm... I'll take a look through it when I'm free tonight. I'll follow up if I find anything useful.

Baertram 10/08/17 07:21 AM

Just checked ingame:
If the "report player" screen is shown the variable SCENE_MANAGER.currentScene.name = "helpCustomerSupport".
Scene = HELP_CUSTOMER_SUPPORT_SCENE

One fragment of this scene (SCENE_MANAGER.currentScene.fragments) is (within keyboard mode! Did not check the gamepad mode!)
HELP_CUSTOMER_SERVICE_ASK_FOR_HELP_KEYBOARD_FRAGMENT

So you could try to check if this fragment is only active as the "report player" interaction was executed (or maybe too if the /bug report is started).

You could use the callback funciton on "fragment_shown" state, as shown in the thread that I've linked above, to check for the edit controls are not hidden.

The edit control names are

Player name to report (CT_LABEL)
ZO_Help_Ask_For_Help_Keyboard_ControlDetailsTextLineFieldText

Description text (CT_LABEL)
ZO_Help_Ask_For_Help_Keyboard_ControlDescriptionBodyFieldText

You are able to change the text in the description field by using something like this:

ZO_Help_Ask_For_Help_Keyboard_ControlDescriptionBodyFieldText:SetText("Hello world")

This worked for me.


Example code:
Lua Code:
  1. HELP_CUSTOMER_SERVICE_ASK_FOR_HELP_KEYBOARD_FRAGMENT:RegisterCallback("StateChange",  function(oldState, newState)
  2. -[[ possible states are:
  3.                 SCENE_FRAGMENT_SHOWN = "shown"
  4.                 SCENE_FRAGMENT_HIDDEN = "hidden"
  5.                 SCENE_FRAGMENT_SHOWING = "showing"
  6.                 SCENE_FRAGMENT_HIDING = "hiding"
  7.             ]]--
  8. if newState == SCENE_FRAGMENT_SHOWN then
  9.    local descCtrl = WINDOW_MANAGER:GetControlByName("ZO_Help_Ask_For_Help_Keyboard_ControlDetailsTextLineFieldText", "")
  10. if descCtrl  ~= nil then
  11.  descCtrl:SetText("Hello World")
  12. end
  13. end
  14. end) -- function

If this doesn't work maybe try to add a small delay via function zo_callLater(function(), delayInMilliseconds) for testing purposes before the control get's assigned to descCtrl. Sometimes the controls are not always "there" already if a sene or fragment is shown.

Drummerx04 10/08/17 03:15 PM

Quote:

Originally Posted by Baertram (Post 32871)
Just checked ingame:
If the "report player" screen is shown the variable SCENE_MANAGER.currentScene.name = "helpCustomerSupport".
Scene = HELP_CUSTOMER_SUPPORT_SCENE

One fragment of this scene (SCENE_MANAGER.currentScene.fragments) is (within keyboard mode! Did not check the gamepad mode!)
HELP_CUSTOMER_SERVICE_ASK_FOR_HELP_KEYBOARD_FRAGMENT

So you could try to check if this fragment is only active as the "report player" interaction was executed (or maybe too if the /bug report is started).

You could use the callback funciton on "fragment_shown" state, as shown in the thread that I've linked above, to check for the edit controls are not hidden.

The edit control names are

Player name to report (CT_LABEL)
ZO_Help_Ask_For_Help_Keyboard_ControlDetailsTextLineFieldText

Description text (CT_LABEL)
ZO_Help_Ask_For_Help_Keyboard_ControlDescriptionBodyFieldText

You are able to change the text in the description field by using something like this:

ZO_Help_Ask_For_Help_Keyboard_ControlDescriptionBodyFieldText:SetText("Hello world")

This worked for me.


Example code:
Lua Code:
  1. HELP_CUSTOMER_SERVICE_ASK_FOR_HELP_KEYBOARD_FRAGMENT:RegisterCallback("StateChange",  function(oldState, newState)
  2. -[[ possible states are:
  3.                 SCENE_FRAGMENT_SHOWN = "shown"
  4.                 SCENE_FRAGMENT_HIDDEN = "hidden"
  5.                 SCENE_FRAGMENT_SHOWING = "showing"
  6.                 SCENE_FRAGMENT_HIDING = "hiding"
  7.             ]]--
  8. if newState == SCENE_FRAGMENT_SHOWN then
  9.    local descCtrl = WINDOW_MANAGER:GetControlByName("ZO_Help_Ask_For_Help_Keyboard_ControlDetailsTextLineFieldText", "")
  10. if descCtrl  ~= nil then
  11.  descCtrl:SetText("Hello World")
  12. end
  13. end
  14. end) -- function

If this doesn't work maybe try to add a small delay via function zo_callLater(function(), delayInMilliseconds) for testing purposes before the control get's assigned to descCtrl. Sometimes the controls are not always "there" already if a sene or fragment is shown.

Okay, I finally had some time to poke through this problem with your guidance.

You were extremely close with your Controls, specifically
Lua Code:
  1. ZO_Help_Ask_For_Help_Keyboard_ControlDescriptionBodyFieldText:SetText()
on this control actually sets the gray text that disappears when you go to type in a report...

However, some poking around revealed its parent
Lua Code:
  1. ZO_Help_Ask_For_Help_Keyboard_ControlDescriptionBodyField:SetText("")
this control actually sets the white text (The actual description field) that I needed and automatically activates the submit button (which still needs to be pressed for now).

Even better, no delay or extra callbacks are even required. I can just call up the report window and instantly set the control fields.

Your insight and guidance was invaluable, now that I have an idea how to poke around existing GUI environments, things are going to get more interesting for sure.

Drummerx04 10/08/17 03:56 PM

And just to add sugar on top:

Lua Code:
  1. ZO_Help_Ask_For_Help_Keyboard_ControlSubcategoryComboBoxSelectedItemText:SetText("Botting")

I can set the subcategory as "Botting" even though ZoS removed the option from the menu.

I do have one more question: My addon is on ESOUI and can be manually downloaded and install... but I don't see it on Minion and it has been up and Approved for several days now (in it's non automatic report fill in state). Is there something I need to do to get it to show up there?

Thanks again!

EDIT: Changing the ComboBox Text does not seem to affect the submitted ticket... In fact the ticket seems to be ignored by ZOS's auto reply system.

Letho 10/09/17 08:12 AM

Please make sure you clarify on the addon's purpose. No need for ppl getting rekt by good players just having to rage press one key for filing a cheat report. :)


All times are GMT -6. The time now is 04:44 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI