Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 11:56

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Autoit]Help

Discussion on [Autoit]Help within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 26
Join Date: Jan 2016
Posts: 47
Received Thanks: 234
[Autoit]Process Suspender Probleme

Can Someone help me on my process Suspender!?
Dexinion is offline  
Old 01/23/2016, 19:00   #2
 
elite*gold: 5
Join Date: Feb 2014
Posts: 654
Received Thanks: 1,857
First of all, it's not yours. It's just a simple source you copied.
Second, try reading the error line, it will help alot even if the solution or problem is **** simple.
Deverixz is offline  
Old 01/23/2016, 20:36   #3
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Quote:
Originally Posted by Deverixz View Post
First of all, it's not yours. It's just a simple source you copied.
Second, try reading the error line, it will help alot even if the solution or problem is **** simple.
^this and besides try using a better thread title. "Help" doesn't give any relevant information about your problem.
alpines is offline  
Thanks
2 Users
Old 01/24/2016, 01:45   #4
 
elite*gold: 20
Join Date: Mar 2015
Posts: 2,206
Received Thanks: 759
ja ne. wenn man die funcs in die while donnert isset ja auch kein wunder das dein script nicht funkt. wenn du schon dir dein source zamm klaust dann mach es doch vernünftig.

isset eig noch erlaubt mit #request4ban oder so? wenn ja würde ich das machen. wenn nicht beachtet das einfach garnicht.
Traumhändler is offline  
Old 01/29/2016, 16:28   #5
 
[Beatrice]'s Avatar
 
elite*gold: LOCKED
Join Date: Oct 2014
Posts: 1,258
Received Thanks: 12,469
*** 1337 0815 hexz coder (c++,c# and autoit) pro coder who doesnt copy paste ****.
Mind checking the error line? *** ur being so pro at checking variables on the error line.
Edit : why the **** you are placing the udf inside while, looks lame.
[Beatrice] is offline  
Old 01/29/2016, 18:05   #6
 
elite*gold: 0
Join Date: Dec 2015
Posts: 79
Received Thanks: 107
Code:
╚►C++/C#/Autoit[Coder]◄╝
Says alot..
Fuuki is offline  
Old 01/30/2016, 11:24   #7
 
mlukac89's Avatar
 
elite*gold: 0
Join Date: Sep 2010
Posts: 473
Received Thanks: 104
First of all when i puted this code in autoit i get few errors, then i try it it dont work, so here u go working one.

Btw for start process from windows itself u can do it with ShellExecute or Run commands, but in your case u need path to the game exe file so u can start it only with process name because its not in windows core.


Best solution will be to just add 1 more button so u can add path to exe file then write it in ini file or registry and save it when u exit program.


Then when u load program again make function to read registry or ini file where u saved path to game and u will be able to start game from button.


U can test with explorer.exe shut it down and turn back up with button.


Code:

#RequireAdmin
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ###
$Form1_1 = GUICreate("", 331, 145, 329, 285)
$Button1 = GUICtrlCreateButton("Suspend S4Client", 120, 48, 99, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Resume S4Client", 120, 80, 99, 25, $WS_GROUP)
$process = GUICtrlCreateInput("Process Name!", 112, 16, 121, 21)
$Label1 = GUICtrlCreateLabel("Created By Dexinion", 96, 112, 148, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Exit


        Case $button1
            _ProcessSuspend($process)


        Case $button2
            _ProcessResume($process)


    EndSwitch
WEnd


Func _ProcessSuspend($process)


#cs


    Error messages


    Success:    1.
    Failure:    0 and sets the @error flag to non-zero.
    @error:    1 = OpenProcess failed
    2 = AdjustTokenPrivileges Failed
    3 = TerminateProcess Failed
    4 = Cannot verify if process exists
    @extended:    sets to Windows API GetLastError()


#ce
    $process_name = GUICtrlRead($process) ; read process name from input


    ; check if process exists
    If ProcessExists($process_name) Then
        ; close process
        ProcessClose($process_name)
    Else
        ; if any error show message with error number ( if u made this for yourself only leave it as it is, if its for others put friendly user message )
        MsgBox(0, "Info", "There was a error" & @CRLF & "Error " & @error & ", " & @extended)
    EndIf


EndFunc


Func _ProcessResume($process)


    $process_name = GUICtrlRead($process) ; read process name from input


    ShellExecute($process_name)




EndFunc


If u make it for yourself only


Code:

#RequireAdmin
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 285, 55, 192, 124)
$Button1 = GUICtrlCreateButton("Start S4 League ", 27, 16, 107, 25)
$Button2 = GUICtrlCreateButton("Close S4 League ", 151, 16, 107, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
		Exit


		Case $Button1
			_ProcessResume()


		Case $Button2
			_ProcessSuspend()




	EndSwitch
WEnd


Func _ProcessSuspend()


	$process_name = "S4league.exe" ; change this to right one, i dont know process name
	If ProcessExists($process_name) Then ProcessClose($process_name)


EndFunc


Func _ProcessResume()


	$path_to_game = "C:\Program Files\S4league\S4league.exe" ; change this to yours game path
	ShellExecute($path_to_game)


EndFunc
mlukac89 is offline  
Thanks
1 User
Reply




All times are GMT +1. The time now is 11:56.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.