komefai / ps4macro Goto Github PK
View Code? Open in Web Editor NEWAutomation utility for PS4 Remote Play written in C#
Home Page: http://blog.komefai.com
License: MIT License
Automation utility for PS4 Remote Play written in C#
Home Page: http://blog.komefai.com
License: MIT License
Somehow my .dll script does not recognize:
script.Press(new DualShockState() { Options = true });
if I record a macro and play it afterwards, the options button will be used. But if i want to include this in my .dll script it the options button does not get recognized
Hi i dont have problem when i open the dll file but i got an ERROR when i press PLAY on PS4Macro, that say:"MEMORIA INSUFFICIENTE", in english is:" INSUFFICIENT MEMORY".
NB if i comment the line 28 to 32, when i press play i don't have problem, so i think that is the command :"HandleScenes"(line 28) that give me error
I fixed my problem and i dont know how to delete the post...
Is it possible to stop autocalling the update function so that it will only execute once?
when i open macro, it fail to inject :/
Is it possible to push and hold a button for a specific length of time? When writing macro in c#
Hello , the app is great uve done good job on it, i am trying to use it in Destiny 2, but i am not good with C# at all , what i would want is a script that randomizes certain buttons and sticks so it never does the same commands over and over again. Also wanna ask if its possible to create a script where it has for example no recoil for some guns. I know crounsmax can do this and there are alot of scripts for it. But since i dont have one this is the closest thing to it. Would been Nice if this program had like a site where users can share scripts to help noobs like me cause i have no idea how to code in C.
I watched all of ur yt tutorials , do u think it would be possible to make a bot for destiny 2 ? or would that be really complicated ? I also heard you say u can make aimbots is that even possible in destiny 2 ?
Thank you for your time .
I'm currently writing my own PS4 Remote interceptor which is able to stream content to an Android Smartphone and also injects gamepad inputs by using your logic of the PS4RemotePlayInterceptor. However, I'm not able to emulate the Touchpad. Clicks are working but movements will not be detected or just be ignored. The PS4Macro is also not able to record Touchpad movements or is this just not implemented yet? Do you have any experience with this issue?
I do the usual checks and it wont register as a remote (when I start)
It could be usefull to integrate Tesseract to method MatchTemplate.
You already have PixelMap and RectMap to call it. I'd like to have a new type "TextMap" to call it. This one would use Tesseract.
namespace PS4MacroAPI
{
public struct TextMap
{
public string ID { get; set; }
public int X { get; set; }
public int Y { get; set; }
public string Text { get; set; }
}
}
After saving the remapper, it does not overwrite the script that is ran, the remapper keeps the controls, but not the script stays to default.
playmacro()Command play twice if emulateController
my game need to press R1 L1 at same time to activate
Thank you for sharing this project. I've search for something like this for a while.
Am I correct that it's not possible to remap a left or right touchpad press? I can't start PS2 games on remote play without a right press on the touchpad.
Regardless, great work.
By motion control, I mean tilting/moving of controller etc that some games require.
Hi Komefai,
I don't find how to leave you a message, so I create an issue to say to you that I create a bot for PES2018Lite (free 2 play) simulation game mode.
This bot works only for FRENCH version of PES. Sorry for others, but french is the best 4 ever. ;c)
thancks for your work and your video. It permits me to create PES easely.
Bye.
I tested with doax3fgrinder
Currently having issues using PS4Macro. For some reason, some buttons work and some don't. For example, I've managed to get the following buttons to work ( X, O, Dpad Up, Dpad Down, Dpad Left, Dpad Right ). Those are the only buttons I can get working, I'm trying to get all of the buttons to work but I mainly need Triangle to work but I can't seem to do so.
In status checker with DS4 connected to PC via USB cable I have this:
Interceptor: Working
Keyboard: Working
Mouse: Working
But triangle still doesn't work.
In status checker WITHOUT DS4 connected to PC I have this:
Interceptor: Not Working
Keyboard: Working
Mouse: Working
I've tried running it as administrator but only the buttons I've posted above worked. Any ideas?
The method MatchTemplate() throws 'out of memory' exception in my computer. I don't really understand why, but it depends of ratio of remote screen. It probably comes from 'System.Drawing'. Maybe the 'Hash' value make it appends.
Any idea to fix it ?
Above the code of my scene
class pressStart : Scene
{
public override string Name => "Root : Press start";
public static RectMap pressStartScreen = new RectMap()
{
Width = 929,
Height = 529,
Hash = 8584986722532864
};
public override bool Match(ScriptBase script)
{
/* DEBUG */
int i = 0;
try
{
for (i = 100; i != 0 && !script.MatchTemplate(pressStartScreen, i); i--) { }
}
catch (System.OutOfMemoryException e)
{
Console.WriteLine("{0} : Error Message = {1} (i = {5}, W = {2}, H = {3}, Hash = {4})", Name, e.Message, pressStartScreen.Width, pressStartScreen.Height, pressStartScreen.Hash, i);
return false;
}
Console.WriteLine("{0} : i= {1} %", Name, i);
System.Diagnostics.Debug.WriteLine("{0} : i= {1} %", Name, i);
return script.MatchTemplate(pressStartScreen, 98);
}
public override void OnMatched(ScriptBase script) => script.Press(new DualShockState() { Cross = true });
}
I'm a beginner in C#.
edit1 : This exception appends when resizing remote screen while playing macro.
edit2: maybe values Width and Height makes it appends.
Hey. Please contact me on skype: prezesku, or via fb: https://www.facebook.com/mateusz.pilecki
I got a job for you regarding ps4 remote play :)
So I Do Everything I Am Supposed To Do And Then I Go To Files Open Then I Go To The PS4Macro dll File And Then It Shows An Error Plz Help Me
I had lots of trouble getting the internal Image Hashing to correctly identify frames and matching them without too many false positives.
I was able to utilize Emgu CV as an optimal library to match scenes. The basic gist of it is to ingest the Bitmap, transform it into grayscale, and use the Canny Edge Detection method to get all the outlines (based on various thresholds I would provide. (Demo) here. Finally I would compare this to a saved Canny image by normalizing the two values to get a similarity
value. Depending on my thresholds, no false positives!
Thoughts?
I'm trying to create a Bot that farm codes and apply it into a game. This Bot should be able to write text (a word with 10 characters). Do you know how this can be made by using PS4Macro (or even rewriting the base code)?
Is it possible to use this tool to log out of PSN account on PS4 and change/log into another account one. without having to restarting remote play tool?
Dear developer,
I've downloaded the latest 0.5.1 BETA Version of PS4Macro because I wanted to try the keyboard mappings within PS4 Remote Play (Version 2.5.0.9220).
I opened PS4 Remote Play first and started the PS4Macro afterwards. I opened the Remapper Tool as you described it in your wiki and focused the PS4 Remote Play Windows afterwards again an started the session to my PS4 by clicking on "Start". I further tried to open the PS4Macro programm after the connection to my Playstation 4 was established, but same issue. Just the common keys are working (ENTER for X, ESX for Return, Left/Right Arrow Key).
Another step was to open PS4Macro with following configuration inside the settings.xml:
true
true
true
which gives me an "OnInjectionSuccess 7384". I guess this should be the process ID of the PS4 Remote Play Instance, but I'm still not able to use the extended key mapping (like R1 with E or R2 with O).
At the moment I have no PS4 Controller connected to my USB because as far as I understood this is not neccesary when using the "EmulateConntroller" Option?
Do I have any understanding trouble or is there any bug?
If you need further information, don't hesitate to ask me again.
Thank you very much in advance,
Michael
P.S.: I tried to use the Mapping Keys within the FIFA 18 Main Menu.
The mouse is really hard to use. It doesn't work really at all and has really jerked moments, and I can't find any settings that will keep it smooth. What does makeup speed even do?
However I am really proud and exited for this project! Very nice work on this.
wtf
Create settings.xml file, and put this line inside:
true
After injection PS4 Remote Play process won't kill itself when you hit the X button in the upper right corner.
I would like to use my mouse in replacement for my analog stick. But there isn't a box for me to click as you described? What am i doing wrong? Also when do you think the next version of Ps4 Macro will be finished with mouse support?
I have issue when try to display/save CurrentFrame the size it is wrong (i tried to use 720p a 520p resolution the size it is always the same).
If i try to resize RP window it will zoom in/out. (property of size currentFrame are always width:1265 height:683) I don't understand why it get this size.
screen:
https://ibb.co/itqCwT
Also with Screenshot button on menu same issue.
Then can't work plugins cause it will miss information from image
I also download precompiled version and make a screenshot from menu, same issue.
I've read everything on this site and you say "Click on enable mouse" but where? I'm having a hard time finding it.
This issue is for anyone who want to try the "Mouse input" feature in Remapper. The feature not yet ready, and that is why I decided to delay the release of the next version and release this debug build here instead. You can help me improve this feature by testing it with different games and report the bugs in this issue.
Open Remapper and check "Enable Mouse", then click on PS4 Remote Play to focus the window. To stop, you can press Alt+Tab to focus other windows.
NOTE: Default settings are recommended (except for Sensitivity) but feel free to play around with it for different games.
Sensitivity - The amount used to multiply the speed of the mouse
Decay Rate - The amount used to divide the speed of the mouse every frame after the mouse stopped moving
Decay Threshold - Threshold of the speed (will decay until the speed drops below the threshold)
Deadzone - The offset amount from analog stick center to start from (use 0 to start from the center) [Value ranges from 0-127]
Makeup Speed - The amount used to multiply AFTER the mouse speed is scaled into analog values to compensate the lost from the decay
Analog stick movement will start at the green line instead of starting from the exact center.
View source:
https://github.com/komefai/PS4Macro/blob/master/PS4Macro/Classes/Remapping/Remapper.cs
-> Multi-monitor support
-> Middle click bindings
PS4Macro_cf7ce2c.zip -[commit cf7ce2c]
I cannot get both mouse and keyboard input working at the same time with PS4Macro. I'm using the latest development build, cf7ce2c.
If I open Remapper and leave Enable Mouse
unchecked, then the keyboard mappings work great (WASD, Z, etc.). But then if I go back to Remapper and check Enable Mouse
, the mouse works fine but the keyboard completely stops working.
I am running PS4Macro as Administrator, and I'm waiting until PS4 Remote Play is fully loaded before running PS4Macro. Here's my Status Checker output:
I suspect the problem may have something to do with this, but I'm not sure. I get the following exception when I run Remapper:
Title
I am wondering what would be the way to use DS3 controller with this program, also wanna ask one question, Is the macro noticeable or does it just recognize it as controller, cause i want to try using it in Destiny 2 and don't wanna get banned for it :) .
I wonder if there is ready to go xml file that emulates xbox 360
also sorry if i shouldnt have posted this here , dunno where else to ask for help. Thank You
Hi, I'm having difficulty with the Remapper.
Just as a simple test case, I was trying to hit the Triangle button:
I attempted to troubleshoot this with a settings.xml
which included <ShowConsole>true</ShowConsole>
. After restarting everything, the debugging console is launched but nothing is printed therein.
Any ideas? Am I missing something?
Important notes:
There seems to be a weird issue with recording/playback. It will only record/playback if I'm active on another window scrolling, holding down a button or moving mouse. I can tell by what I assume to be frame numbers on bottom right corner. I don't know what could be causing the issue. Thanks for any feedback.
I have a 4k Laptop, and everything can run reallly tiny so I need to use DPI Scaling on my Windows 10 machine to enrich some experiences. This messes with the ScriptConfig.TargetSize
as it won't be accurate when plugging in coordinates.
I feel that determining a multipler and adding to these lines would help.
PS4Macro/PS4MacroAPI/Internal/BackgroundCapture.cs
Lines 63 to 64 in cf7ce2c
Since my Display Scaling is set to 200%, a multipler of 2 on both of these helped me.
The border is also not considered, so when trying to crop, you are offset by the left and top borders around the Remote Play window. If we can determine these values, we can get a coordinate system that's all aligned to the same axes.
Hi Komefai I don't know why when detecting some areas I get "out of memory" error, or maybe the macro is working as intended and when the screen changes: error. Do you have any Ideas why some rectmaps are working and others don't for me?
Also why when I turn start play on the macro my remote play gets out of fullscreen? Is this optional?
Congrats on the great job and regards.
Recording doesn't seem to work no longer. When recording like running in video game. and if that recording is played the left stick is like its barly going forward its not getting recorded correctly.
When launching the exe (without RemotePlay actually opened), there is an "Unhandled" error with MainForm.cs at line 68. Reference is not defined to an object.
System.NullReferenceException
But it's working if you open it after launching the remote play app.
Hi Komefai. First of all, thank you for your work.
I have a question about pressing buttons. My script works well on my computer, but when it runs on my friend's computer, it sometimes does not pressing a button.
Press(new DualShockState() { DPad_Up = true }); // always pressing
Sleep(1000);
Press(new DualShockState() { Square = true }); // sometimes not
FYI, the loop delay is 3 seconds.
Do you have any idea?
Hi. I'm writing heres since I don't really know where to report this problem.
Today I've downloaded your app and followed your tutorial to script a simple code as a test but when I tried to start it in the program i got this window
I'm new to coding but the script was pretty simple, just a few button pressings without conditions. if needed I can load it here.
ps: I've only tried on one pc so I can't exclude the problem is mine, but I didn't have the time to test it elsewhere today.
Hi, so I'm trying to get PS4 Macros working on Remote Play on my laptop, and I've been having issues with it getting to properly work with my Remote Play. I've already went over a couple of the issue threads posted here, and I've tried various things to fix this, but in the end I just can't get this working at all. Here's EXACTLY what I did, over and over again:
I first installed PS4 Macros and extracted it onto my laptop.
I then created a new text file inside the PS4 Macros file, naming it "settings.txt", and then copy and pasted these settings:
Then I made the txt file into xml file.
I FIRST ran Remote Play and after that, instead of hitting the "Start" button on it, I then ran the PS4 Macros application (ran it as administrator).
Based on my research from Youtube tutorials and from issue threads here, it should say on the Remote Play "Press option to start" because that's when the Remote Play recognizes the emulator controller, but it doesn't happen for me at all.
Also note that I've installed the latest updated version of PS4 Macros.
So I'm not sure what's causing the problem. Did I do something wrong during the entire process? Did I forget to configure something or download something else before doing any of the steps that I mentioned above? I'm not able to use this on my Remote Play at all and I can only use the base controls (enter for X, esc for O, arrows for up, down, right, left). I've also tried configuring the Remapper and such but I just have absolutely no idea how to fix this. I also tried to load xml files in the Macros column of the Remapper (2nd column to the very left at the bottom) but I honestly don't know if that did anything as well. I'm not sure if I've missed something specific here. I've been trying to get this to work for hours but have absolutely no clue how to fix this. I'd appreciate it if anyone can help and advise me to get this to work.
Greeting. This is not actually an issue.
Due to using of PS Remote play in a emulated environment (Virtual box) with win7 being a host system,any usage of wired DS4 controller crashes my system.
So I cannot record any macros with this great product.
But I still would like to test if those macros would be played and percepted by PS RP.
For that reason I would like to see any working macro in XML format so I could possibly adapt it for my needs. I am not any good in C# coding (can code a little with python/php/asm) and the limited emulated environment has no resources to install MS VS, so coding a dll is not an option for me :(
Thank you guys.
And thumbs up for good work for komefai!
Every time I try to build it it errors saying the easyload32.dll is locked by ps4 remote play and that it fails to copy easyload32.dll to bin\debug\EasyLoad32.dll because it cannot be accessed as it's being used by another process
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.