Help me please for mod ui

laymarco

HI
the +connect <ip:port> command does help to bypass the clicks required to connect to the server, but I still have to select the option to "load circuit" and the to "RACE".......and I want to bypass these too

guys please let me know if you have any solutions/suggestions......
 
Other than supplying the password (+password "<Password Here>") on the command line that is as far as you can go. My only suggestion would be to check out AutoHotkey. You can use that to emulate mouse clicks and keyboard inputs. I use it for all my sims. I have a "Reset" button on my wheel and when I press it, AutoHotkey does these steps:
Press <ESC> on the keyboard
Click race at the bottom right of the screen with the mouse.

So, if I am at the monitor it will ignore the <esc> key and then it clicks race. If I am on the track the <esc> key puts me back to the monitor and then it clicks the race button.

Here is a sample script for AutoHotkey:
Code:
#InstallKeybdHook
#UseHook On
SetMouseDelay 0
CoordMode, Mouse, Window

; Force Exit rFactor
^#!q::
	Process, Close, rFactor.exe
Return

; Race / Reset
2Joy2::
	SendFancy("esc")
	MouseClick(96.0156,97.7777) ; Race Button
Return



SendFancy(key)
{
	Send {%key% down}
	sleep, 50
	send {%key% up}
	Sleep, 50
}

MouseClick(x,y)
{
	WinGetPos, , , Win_Width, Win_Height, A
	MouseMove, Win_Width * (x/100), Win_Height * (y/100), 0
	Sleep, 50
	Click, Down
	Sleep, 50
	Click, Up
	Sleep, 50	
}

If you try to automate keyboard/mouse inputs in rFactor the trick is you have to hold the buttons down for at least 50ms. If you look you will see I wrote a "SendFancy" function which holds the key down for 50ms and then releases it. The "MouseClick" function lets you supply the X/Y coordinates as screen percentages. For example 50,50 would be dead center of the screen. 0,0 is top left and 100,100 is bottom right. I do it this way so that it is independant of your resolution. I run rF at 1920x1080 but sometimes I run it in a window at 1280x720 when reviewing replays and stuff like that. What I do is take a screenshot of any screen in rF you want to automate. Then open it up with a photo editor that will let you hover the mouse over a button and display the x/y pixel location. Then do the math to convert it to percentages. Then plug them into your AutoHotkey script. To simplify things I use xUI as my default UI across all mods. So the button locations stay the same with all mods.

You should be able to do what you are asking with this.

Oh yeah, I also have a force kill in there. If you hit Ctrl+Win+Alt+Q it will kill rF. If you just want to quickly exit and don't care about saving replays or anything it is a little faster. It's also handy when rF hangs when doing Alt+Tab.
 

Back
Top