zmilla93 / SlimTrade

A trade UI overlay for Path of Exile
MIT License
122 stars 13 forks source link

Automatic Quick Paste non-functional #23

Closed videnfost closed 3 years ago

videnfost commented 4 years ago

I have recently installed this program and it's wonderful! I am currently dealing with an issue where I try to use Automatic Quick Paste for trade whispers and it will not send the whisper in-game. The PoE client lights up on my task bar but no whisper gets sent until I alt-tab back into the game and control-v into the chat box.

I'm running what I assume is the latest version of SlimTrade as I just installed it hours ago. I have attempted closing PoE and re-opening it, closing SlimTrade and re-opening it, as well as restarting my computer but nothing will cause the Automatic Quick Paste to function correctly.

zmilla93 commented 4 years ago

Couple of questions.

Thanks for the report!

videnfost commented 4 years ago

I am using Windows 10 Pro with English setting.

Clicking the whisper button is what causes PoE to light up on the task bar, yes. The game does not popup or focus at all.

I will have to test if the hotkey is bugged as well. I will update when I find out!

Kattsallad commented 4 years ago

I had similar issues today when i ran Slimtrade. I would get the notification for an item selling but i was not able to use any of the macro buttons to respond. It would copy the text to clipboard but never actually send them through the chat.

I updated Java to the latest version but still no changes, i also noticed that whenever i would go out from PoE the overlay would go away and it wouldnt come back until i opened the Slimtrade options from the taskbar icon.

However when i ran Slimtrade through powershell with the -jar command it would work as inteded. So i assumed it was some new windows nonsense since they released an update recently. I ended up writing a script that opened Slimtrade with elevated permissions with a powershell script and skip the debugging window. I am the only user on the computer and i have full admin rights, so there was no reason for this to make a difference but it did.

Running Windows 10 Pro English, no modifications or additions.

videnfost commented 4 years ago

Yes the hotkey version seems to work just fine. I click on the trade text, then press the hotkey and the game focuses and sends the whisper. But the automatic one is the one that is getting stuck trying to focus back into the game and lighting up the taskbar.

Kattsallad any chance you can share that script with me? It would help a lot :)

Kattsallad commented 4 years ago

@videnfost Sure

@echo off

:: BatchGotAdmin
:-------------------------------------
REM  --> Check for permissions
    IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
) ELSE (
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
)

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    set params= %*
    echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    del "%temp%\getadmin.vbs"
    exit /B

:gotAdmin
    pushd "%CD%"
    CD /D "%~dp0"
:--------------------------------------    

start YOURSLIMTRADEPATH
Exit

If you dont know how to run this just copy the code into a txt file and save it, then change the file extention to be .bat instead of .txt

Make sure to edit the path to your slimtrade at the bottom of the script, if you run the script in the same directory as your slimtrade.jar you can just type "SlimTrade.jar" without the quotes.

zmilla93 commented 4 years ago

@videnfost Strange that the hotkey works and the automated version doesn't as it calls the same code. The fact that POE lights up in the tray indicates it starts that mutual process, but since POE is never focused it just times out. You could try running SlimTrade from the command line to see if there is any errors, although I would be surprised based on what you described. Will continue to investigate.

@Kattsallad Very strange issue. Did SlimTrade ever work correctly for you, or was it only when you last updated Windows? Also if just running the program from the command line fixes the issue, wouldn't it be enough to just use start java -jar SlimTrade.jar in your bat file instead of modifying permissions? This would actually be really useful to know since I have an idea for a fix if it does work that way.

I found a very small bug in the code that interfaces with POE, but honestly not sure if it will address either problem. Feel free to try and report the results. I'm hoping to release a new version of SlimTrade in the next week or so that will generate log files to help with debugging more.

SlimTrade Test Fix

Kattsallad commented 4 years ago

@zmilla93 Its my first time trying slimtrade. I did use mercurytrade prior but decided it was time to swap since its not maintained anymore but mercurytrade worked without any problems. Problem with running it through Java runtime is that it opens up a debug window, using my script will open the program normally with elevated permissions.

I tried the test fix and i have the same behavior when not running elevated or with "java -jar SlimTrade.jar"

zmilla93 commented 4 years ago

Oh right, you should be able to change that to javaw -jar to prevent the console window from opening.

I'm working on an automated update system that uses a launcher model to update and run the main program, so that may very well fix it. If the problem persists after that update is released then please open a new issue, as I think it is a different bug that what causes the quick paste issue.

zmilla93 commented 3 years ago

Fixed in v0.3.0.