What's new

[GUIDE] RCRP desktop shortcut

Cain

Silver Member
Joined
May 12, 2013
Messages
1,224
Cheesy said:
Cain said:
I'm having a bit trouble running samp.exe, I'm getting an error "Windows cannot find 'samp.exe'. Make sure you typed the name correctly, and then try again." The AHK script runs without any issues though. Could it be because of the location of the samp file? My San Andreas directory is F:\Program Files (x86)\Rockstar Games\GTA San Andreas\

Try this instead, I just checked and I actually do it in a different way in my own bat. (sry) I think it's passing the ip that screws it up, but this should work:

Code:
@echo off
start "" "C:\Program Files (x86)\Rockstar Games\GTA San Andreas\samp.exe" "188.165.139.152:7777"
start "" "C:\Users\*Name*\Documents\SAMP\AHK\script.ahk"
exit
Of course change the script and program directory as you need. :cowboy:

Hey mate, for some odd reason 80% of the time it starts the ahk script, but it closes it back down automatically while the game starts. You have any idea how to fix this issue?
 

Cheesy

Gold Member
Joined
Jun 1, 2012
Messages
2,137
Location
Sweden
Cain said:
Cheesy said:
Cain said:
I'm having a bit trouble running samp.exe, I'm getting an error "Windows cannot find 'samp.exe'. Make sure you typed the name correctly, and then try again." The AHK script runs without any issues though. Could it be because of the location of the samp file? My San Andreas directory is F:\Program Files (x86)\Rockstar Games\GTA San Andreas\

Try this instead, I just checked and I actually do it in a different way in my own bat. (sry) I think it's passing the ip that screws it up, but this should work:

Code:
@echo off
start "" "C:\Program Files (x86)\Rockstar Games\GTA San Andreas\samp.exe" "188.165.139.152:7777"
start "" "C:\Users\*Name*\Documents\SAMP\AHK\script.ahk"
exit
Of course change the script and program directory as you need. :cowboy:

Hey mate, for some odd reason 80% of the time it starts the ahk script, but it closes it back down automatically while the game starts. You have any idea how to fix this issue?

Does your autohotkey script contain a block to automatically close itself?
 

Cain

Silver Member
Joined
May 12, 2013
Messages
1,224
Cheesy said:
Cain said:
Cheesy said:
Cain said:
I'm having a bit trouble running samp.exe, I'm getting an error "Windows cannot find 'samp.exe'. Make sure you typed the name correctly, and then try again." The AHK script runs without any issues though. Could it be because of the location of the samp file? My San Andreas directory is F:\Program Files (x86)\Rockstar Games\GTA San Andreas\

Try this instead, I just checked and I actually do it in a different way in my own bat. (sry) I think it's passing the ip that screws it up, but this should work:

Code:
@echo off
start "" "C:\Program Files (x86)\Rockstar Games\GTA San Andreas\samp.exe" "188.165.139.152:7777"
start "" "C:\Users\*Name*\Documents\SAMP\AHK\script.ahk"
exit
Of course change the script and program directory as you need. :cowboy:

Hey mate, for some odd reason 80% of the time it starts the ahk script, but it closes it back down automatically while the game starts. You have any idea how to fix this issue?

Does your autohotkey script contain a block to automatically close itself?

Nah.
 

Cheesy

Gold Member
Joined
Jun 1, 2012
Messages
2,137
Location
Sweden
Cain said:
Cheesy said:
Cain said:
Cheesy said:
Cain said:
I'm having a bit trouble running samp.exe, I'm getting an error "Windows cannot find 'samp.exe'. Make sure you typed the name correctly, and then try again." The AHK script runs without any issues though. Could it be because of the location of the samp file? My San Andreas directory is F:\Program Files (x86)\Rockstar Games\GTA San Andreas\

Try this instead, I just checked and I actually do it in a different way in my own bat. (sry) I think it's passing the ip that screws it up, but this should work:

Code:
@echo off
start "" "C:\Program Files (x86)\Rockstar Games\GTA San Andreas\samp.exe" "188.165.139.152:7777"
start "" "C:\Users\*Name*\Documents\SAMP\AHK\script.ahk"
exit
Of course change the script and program directory as you need. :cowboy:

Hey mate, for some odd reason 80% of the time it starts the ahk script, but it closes it back down automatically while the game starts. You have any idea how to fix this issue?

Does your autohotkey script contain a block to automatically close itself?

Nah.
Send the batch script and autohotkey script in a PM and i'll take a look at it.
 

Cheesy

Gold Member
Joined
Jun 1, 2012
Messages
2,137
Location
Sweden
We managed to solve the issue that Cain had. For future reference in case anyone else runs into it; if you're going to use the automatic script exit that I proposed on the second page:
Code:
loop {
      sleep 6000
      IfWinNotExist, ahk_class Grand theft auto San Andreas
      {
         ExitApp
      }
   }

Use this instead:
Code:
loop {
		sleep 10000
		IfWinNotExist, ahk_class Grand theft auto San Andreas
		{
			IfWinNotExist, ahk_class #32770
			{
				ExitApp
			}
		}
	}

Essentially the reason it may shut down if the loop isn't delayed for long enough is because before the main "Grand theft auto San Andreas" task starts and is registered by ahk, the game starts another task (device selection) that can be identified by the ahk class "#32770". A simple solution to the issue without delaying the loop any more is to simply check if this task exists as well before closing the script.
 
Top