• بادئ الموضوع بادئ الموضوع ashalshaikh
  • تاريخ البدء تاريخ البدء
  • المشاهدات 114,207
السلام عليكم ورحمت الله وبركاته
تعالواااااااااااااااا ننشط الموضوع طالما الموضوع اصبح راكد اوىى ورخم جداااااااااا
PHP:
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.1.1.0
 Author:         Truong Son <teentitan1986@gmail.com>
 Auto Pot version: 1.2 rc4
 Code Name: Hunter
 Descript:
 Auto Pot application for SRO
 Chuc nang:
 Auto pot when press F5
 Auto loot (use g short key) (don't auto loot when attacking)
 Quick terminate SRO by press F10
 Auto use skill attack when target mob by press F6
 Auto use skill buff by press F6
#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <GuiConstants.au3>
#include <Misc.au3>

#NoTrayIcon

; ----------------------------------------------------------------------------
; System configs (don't change anything) ---------------------------------
; ----------------------------------------------------------------------------
Const $version = "v1.2 RC4"
Const $author = "Truong Son <teentitan1986@gmail.com>"
Const $whatIs = "Auto Pot"

Const $keyLoot = "g" ; short cut key to auto loot
Const $loop_delay = 250
Const $click_delay = 1000
Const $short_key = "F1-1|F1-2|F1-3|F1-4|F1-5|F1-6|F1-7|F1-8|F1-9|F1-0|F2-1|F2-2|F2-3|F2-4|F2-5|F2-6|F2-7|F2-8|F2-9|F2-0|x|none"
Const $short_key_2 = "1|2|3|4|5|6|7|8|9|0|x|none"

Const $buff_nums = 7
Const $att_nums = 7

Const $max_bodem = 7

; Mob information -----------------------------------------------------------
; Check if mob's HP bar is still availble
Const $HPmobcolor = 0xFFC6C6
Const $HPmobcoord[2] = [76,45]

#cs
; mob's HP check system, if HP of mob is too low, skill two will be ignore
; absolute not use
Const $HPmobcolor_Low = 0xFFC6C6
Const $HPmobcoord800_low[2] = [337,555] ; HP mob is 5%
Const $HPmobcoord1024_low[2] = [449,723]
Dim $HPmobcoord_low[2]
#ce

; HP / MP player info --------------------------------------------
Const $baseMincoordX = 84 ; left coord
Const $baseWidthcoordX = 124 ; HP/MP bar long

Const $baseHPcoordY = 32 ; top coord HP

Const $baseMPcoordY = 48 ; top coord MP

Const $baseHPcolor = 0x68040F
Const $baseMPcolor = 0x0F1C4C

; Poisoned info --------------------------------------------------
Const $poison_coord[2][2] = [[218,59],[218,61]]
Const $poison_base_color1 = 0x84E7FF
Const $poison_base_color2 = 0x000000

; ----------------------------------------------------------------------------
; auto system config ---------------------------------------------------------
; ----------------------------------------------------------------------------
Dim $auto_loot = False ; auto Loot
Dim $auto_pot = False ; auto Pot
Dim $auto_att = False ; auto skill attack
Dim $auto_buff = False ; auto skill buff
Dim $auto_pill = True ; auto pill
Dim $auto_heal = False ; auto skill restore HP
Dim $auto_click = False ; auto mouse click
Dim $isAttacking = False ; is attacking mob
;Dim $isLowHP = False ; check if mob is too low HP
Dim $showHelp = False ; show help tooltip

; ----------------------------------------------------------------------------
; Key system (temp) -------------------------------------------
; ----------------------------------------------------------------------------
Dim $keyHP = "8"
Dim $keyMP = "9"
Dim $keyPill = "0"
Dim $keyHeal = "7"

; ----------------------------------------------------------------------------
; Temp values ----------------------------------------------------
; ----------------------------------------------------------------------------
;Dim $HPcolor ; HP bar color
;Dim $MPcolor ; MP bar color

Dim $HPdeg = 25 ; HP bar degree
Dim $MPdeg = 30 ; MP bar degree
Dim $HPdegHeal = 50 ; HP bar heal skill degree

Dim $click_init ; time clicking init

; array to store client position
Dim $arr_client_pos[4]

;Dim $gui_avail = False
;Dim $show_tool_tip = False

; ----------------------------------------------------------------------------
; Skill shedule system -------------------------------------------------------
; ----------------------------------------------------------------------------
; att_skill and buff_skill list info: 
; [0] skill key (table F1 with attack skill and table F1 and F2 with buff skill)
; [1] skill delay (use mili second)
; [2] skill use order: 
; -1: don't use again
; 0: is waiting to use
; 1: will be use
; [3] store skill color (not use this time)
; [4] time wait still first time
Dim $att_skill[$att_nums][5]
Dim $buff_skill[$buff_nums][5]

; ----------------------------------------------------------------------------
; Main application -----------------------------------------------------------
; ----------------------------------------------------------------------------
readIni()
setKeys()
showGUI()

; ----------------------------------------------------------------------------
; Functions ------------------------------------------------------------------
; ----------------------------------------------------------------------------
Func setKeys()
	HotKeySet("{F5}","toggleAutoPot")
	HotKeySet("{F6}","toggleAutoAtt")
	HotKeySet("{F10}","killSro")
	;HotKeySet("{F7}","killSro")
	HotKeySet("^q","terminateIt") 
	HotKeySet("^{F1}","toggleshowHelp")
	HotKeySet("^{F2}","toggleshowApp")
	HotKeySet("{F7}","toogleAutopickup")
	HotKeySet("{F8}","toogleAutoClick")
EndFunc

; ----------------------------------------------------------------------------
Func toggleAutoPot()
	$auto_pot = Not $auto_pot
	ToolTip("AutoPot is now " & $auto_pot,0,0)
	Sleep(500)
	ToolTip("",0,0)
EndFunc

Func toggleAutoAtt()
	checkClientPos()
	$auto_att = Not $auto_att
	ToolTip("Auto Attack is now " & $auto_att,0,0)
	Sleep(500)
	ToolTip("",0,0)
EndFunc

Func toogleAutopickup()
	$auto_loot = Not $auto_loot
	ToolTip("Auto Loot is now " & $auto_loot,0,0)
	Sleep(500)
	ToolTip("",0,0)
EndFunc

Func killSro()
	$sro_hWnd = ProcessExists("SRO_Client.exe")
	If $sro_hWnd Then 
		ProcessClose($sro_hWnd)
	EndIf
EndFunc

Func terminateIt()
	Exit 0
EndFunc

Func toggleshowHelp()
	$showHelp = Not $showHelp
	checkClientPos()
	Local $help_text = "Help:" & @CRLF _
						&"Press F5 to turn On/Off auto Pot" & @CRLF _
						&"Press F6 to turn On/Off auto Skill" & @CRLF _
						&"Press F10 to fast terminate SRO" & @CRLF _
						&"Press Ctrl + F1 to turn On/Off Help" & @CRLF _
						&"Press Ctrl + F2 to application get focus" & @CRLF _
						&"Press F7 to turn On/Off auto Loot" & @CRLF _
						&"Press F8 to turn On/Off auto Click" & @CRLF _
						&"Press Ctrl + q to terminate Auto Pot"
	If ($showHelp == True) Then
		ToolTip($help_text,$arr_client_pos[2] - 195,0)
	Else
		ToolTip("",0,0)
	EndIf
EndFunc

Func toggleshowApp()
	If Not WinActive($whatis & " " & $version) Then
		WinActivate($whatis & " " & $version)
	ElseIf Not WinActive("SRO_Client") Then
		WinActivate("SRO_Client")
	EndIf
EndFunc

Func toogleAutoClick()
	$auto_click = Not $auto_click
	ToolTip("Auto Click is now " & $auto_click,0,0)
	Sleep(500)
	ToolTip("",0,0)
EndFunc
; --------------------------------------------------------------------------
; Main Loop (do all here) --------------------------------------------------
; --------------------------------------------------------------------------
Func mainLoop()
	Local $bodem,$i,$auto_pot_timer
	
	For $i=0 To ($att_nums - 1)
		$att_skill[$i][4] = TimerInit()
		$att_skill[$i][2] = 1
	Next
	For $i=0 To ($buff_nums - 1)
		$buff_skill[$i][4] = TimerInit()
		$buff_skill[$i][2] = 1
	Next
	
	$click_init = TimerInit()
	
	While WinActive("SRO_Client")
		; /Todo: search if activing sro
		WinWaitActive("SRO_Client")		
		
		checkTargeted() ; check what ever targeted, faster cast skill
		
		If ($auto_click == True) Then
			If (TimerDiff($click_init) > $click_delay) And ($isAttacking <> True)Then
				MouseClick("left")
				$click_init = TimerInit()
			EndIf
		EndIf
		
		If ($auto_att == True) Then
			For $bodem=0 To $att_nums-1
				If ($att_skill[$bodem][0] <> "none") And ($isAttacking == True) Then
					If ($att_skill[$bodem][1] < TimerDiff($att_skill[$bodem][4])) And ($att_skill[$bodem][2]<>-1) Then
						Send("{F1}")
						Send($att_skill[$bodem][0])
						$att_skill[$bodem][4] = TimerInit()
						If ($att_skill[$bodem][1] == 0) Then
							$att_skill[$bodem][2] = -1
						EndIf
					EndIf
				EndIf
			Next
		EndIf
		
		If ($auto_pill == True) And ($auto_pot == True) Then
			autoPill()
		EndIf
		
		If ($auto_pot == True) Then
			autoPot()
		EndIf
		
		If ($auto_buff == True) And ($auto_att == True) And ($isAttacking == False) Then
			For $bodem = 0 To $buff_nums-1
				If ($buff_skill[$bodem][0] <> "none") Then
					If ($buff_skill[$bodem][1]+2 < TimerDiff($buff_skill[$bodem][4])/1000) And ($buff_skill[$bodem][2]<>-1) Then
						Send("{" & StringLeft($buff_skill[$bodem][0],2) & "}")
						Sleep(20)
						Send(StringRight($buff_skill[$bodem][0],1))
						Sleep(20)
						$buff_skill[$bodem][4] = TimerInit()
						If ($buff_skill[$bodem][1] == 0 )Then
							$buff_skill[$bodem][1] = -1
						EndIf
						Send("{F1}")
					EndIf
				EndIf
			Next
		EndIf
	
		If ($auto_heal == True) And ($isAttacking == False) Then
			autoHeal()
		EndIf
		
		If ($auto_loot == True) And ($isAttacking == False) Then
			Send("g")
		EndIf
		
		Sleep($loop_delay)

	WEnd
	
EndFunc

; --------------------------------------------------------------------------
Func checkClientPos()
	If WinActive("SRO_Client") Then
		$arr_client_pos = WinGetPos("SRO_Client")
	Else
		$arr_client_pos[0] = 0
		$arr_client_pos[1] = 0
		$arr_client_pos[2] = 800
		$arr_client_pos[3] = 600
	EndIf
EndFunc
 
; --------------------------------------------------------------------------
; Auto Pot:
; Check HP and MP bar color
; If color value of HP and MP bar is not equal color which setted up
; --------------------------------------------------------------------------
Func autoPot()
	; My old stuff
	;$HPcolor = PixelGetColor(Ceiling($baseWidthcoordX * ($HPdeg / 100))+$baseMincoordX+$arr_client_pos[0],$baseHPcoordY+$arr_client_pos[1])
	;$MPcolor = PixelGetColor(Ceiling($baseWidthcoordX * ($MPdeg / 100))+$baseMincoordX+$arr_client_pos[0],$baseMPcoordY+$arr_client_pos[1])
	
	; My old stuff
	;$HPcolor = PixelGetColor(Ceiling(118 * ($HPdeg / 100))+87,34)
	;$MPcolor = PixelGetColor(Ceiling(118 * ($MPdeg / 100))+87,51)
	
	;My old stuff
	;If (($HPcolor<>0x93000E) And ($HPcolor<>0x92000E) And ($HPcolor<>0x91000E) And ($HPcolor<>0x90000E) And ($keyHP <> "none")) Then
	;	Send($keyHP)
	;EndIf
	;If (($MPcolor<>0x1C338C) And ($MPcolor<>0x1C338B) And ($MPcolor<>0x1C338A) And ($MPcolor<>0x1C348A) And ($keyMP <> "none")) Then
	;	Send($keyMP)
	;EndIf
	
	; LMTruong stuff
	$coord = PixelSearch($baseWidthcoordX * ($HPdeg / 100)+$baseMincoordX, $baseHPcoordY, $baseWidthcoordX * ($HPdeg / 100)+$baseMincoordX, $baseHPcoordY, $baseHPcolor, 10, 1)
	If @error Then
		Send($keyHP)
	EndIf
	$coord = PixelSearch($baseWidthcoordX * ($MPdeg / 100)+$baseMincoordX, $baseMPcoordY, $baseWidthcoordX * ($MPdeg / 100)+$baseMincoordX, $baseMPcoordY, $baseMPcolor, 10, 1)
	If @error Then
		Send($keyMP)
	EndIf
	; ~ end
EndFunc

; --------------------------------------------------------------------------
Func autoHeal()
	$coord = PixelSearch($baseWidthcoordX * ($HPdegHeal / 100)+$baseMincoordX, $baseHPcoordY, $baseWidthcoordX * ($HPdegHeal / 100)+$baseMincoordX, $baseHPcoordY, $baseHPcolor, 10, 1)
	If @error Then
		Send($keyHeal)
	EndIf
EndFunc
	
; Auto Pill ----------------------------------------------------------------

Func autoPill()
	$poison_color1 = PixelGetColor($poison_coord[0][0],$poison_coord[0][1])
	$poison_color2 = PixelGetColor($poison_coord[1][0],$poison_coord[1][1])
	If ($poison_base_color1 = $poison_color1) And ($poison_base_color2 = $poison_color2) Then
		Send($keyPill)
	EndIf
EndFunc

; --------------------------------------------------------------------------
; Check if mob is targeted
; LMTruong stuff
; @return Boolean True: mob is targetted, False: mob is not targetted
; --------------------------------------------------------------------------
Func checkTargeted()
	If PixelGetColor($arr_client_pos[2]/2 - $HPmobcoord[0], $HPmobcoord[1]) = $HPmobcolor Then
	;If (PixelGetColor(324,45) == $HPmobcolor) Then
		$isAttacking = True
		Return True
	Else
		For $i=0 To $att_nums-1
			$att_skill[$i][2] = 1
		Next
		$isAttacking = False
		Return False
	EndIf
EndFunc
; ~end

#cs
; @Todo: check HP of mob left
; return True: mob is weaked False:mob still too strong
; This version does not support this stuff
Func checkLowHP()
	If PixelGetColor($HPmobcoord_low[0],$HPmobcoord_low[1]) = $HPmobcolor_Low Then
		Return False
	Else
		Return True
	EndIf
EndFunc
#ce

; ----------------------------------------------------------------------------
Func readIni()
	Local $i
	$auto_loot = IniRead("auto.ini","AutoPot","AutoLoot",False)
	$auto_pill = IniRead("auto.ini","AutoPot","AutoPill",False)
	$auto_heal = IniRead("auto.ini","AutoPot","AutoHeal",False)
	$auto_buff = IniRead("auto.ini","AutoSkill","AutoBuff",False)
	$keyHP = IniRead("auto.ini","AutoPot","HPkey","1")
	$keyMP = IniRead("auto.ini","AutoPot","MPkey","4")
	$keyPill = IniRead("auto.ini","AutoPot","Pillkey","0")
	$keyHeal = IniRead("auto.ini","AutoPot","HPkeyHeal","7")
	$HPdeg = IniRead("auto.ini","AutoPot","HPdegree",25)
	$MPdeg = IniRead("auto.ini","AutoPot","MPdegree",30)
	$HPdegHeal = IniRead("auto.ini","AutoPot","HPdegreeHeal",20)
	For $i = 0 To $att_nums-1
		$att_skill[$i][0] = IniRead("auto.ini","AutoSkill","skill_Att_Key"& $i,"none")
		$att_skill[$i][1] = IniRead("auto.ini","AutoSkill","skill_Att_Delay"& $i,500)
	Next
	For $i = 0 To $buff_nums-1
		$buff_skill[$i][0] = IniRead("auto.ini","AutoSkill","skill_Buff_Key"& $i,"none")
		$buff_skill[$i][1] = IniRead("auto.ini","AutoSkill","skill_Buff_Delay"& $i,500)
	Next
EndFunc

Func writeIni()
	Local $i
	IniWrite("auto.ini","AutoPot","AutoLoot",$auto_loot)
	IniWrite("auto.ini","AutoPot","AutoPill",$auto_pill)
	IniWrite("auto.ini","AutoPot","AutoHeal",$auto_heal)
	IniWrite("auto.ini","AutoSkill","AutoBuff",$auto_buff)
	IniWrite("auto.ini","AutoPot","HPkey",$keyHP)
	IniWrite("auto.ini","AutoPot","MPkey",$keyMP)
	IniWrite("auto.ini","AutoPot","Pillkey",$keyPill)
	IniWrite("auto.ini","AutoPot","HPkeyHeal",$keyHeal)
	IniWrite("auto.ini","AutoPot","HPdegree",$HPdeg)
	IniWrite("auto.ini","AutoPot","MPdegree",$MPdeg)
	IniWrite("auto.ini","AutoPot","HPdegreeHeal",$HPdegHeal)
	For $i = 0 To $att_nums-1
		IniWrite("auto.ini","AutoSkill","skill_Att_Key"& $i,$att_skill[$i][0])
	Next
	For $i = 0 To $buff_nums-1
		IniWrite("auto.ini","AutoSkill","skill_Buff_Key"& $i,$buff_skill[$i][0])
	Next
	For $i = 0 To $att_nums-1
		IniWrite("auto.ini","AutoSkill","skill_Att_Delay"& $i,$att_skill[$i][1])
	Next
	For $i = 0 To $att_nums-1
		IniWrite("auto.ini","AutoSkill","skill_Buff_Delay"& $i,$buff_skill[$i][1])
	Next
EndFunc

; ----------------------------------------------------------------------------
; Show GUI (do not change anything) ------------------------------------------
; ----------------------------------------------------------------------------
Func showGUI()
	
	Local $i,$row_y
	Local $gui_combo_skill_key[$att_nums],$gui_combo_buff_key[$buff_nums]
	Local $gui_input_skill_delay[$att_nums],$gui_input_buff_delay[$buff_nums]
	Local $gui_updown_skill[$att_nums],$gui_updown_buff[$buff_nums]
	Local $gui_label_gp[9]
	Local $state_temp
	
	; Application is still in use
	;If ($gui_avail == True) Then
	;	Return
	;EndIf
	;$gui_avail = True
	
	Local $gui_hWnd = GUICreate($whatis & " " & $version,320, 350)
	Local $sro_folder = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Joymax\Silkroad", "InstallPath")
	If Not @error Then
		GUISetIcon($sro_folder & "\Silkroad.ico", 0, $gui_hWnd)
	EndIf
  
	$gui_help_text = "AutoPot Application " & $version & @CRLF _
					& @CRLF _
					&"Press F5 to turn On/Off autoPot" & @CRLF _
					&"Press F6 to turn On/Off autoSkill" & @CRLF _
					&"Press F10 to fast terminate SRO" & @CRLF _
					&"Press Ctrl + F1 to turn On/Off Help" & @CRLF _
					&"Press Ctrl + F2 to make application get focus" & @CRLF _
					&"Press F7 to turn On/Off auto Loot" & @CRLF _
					&"Press F8 to turn On/Off auto Click" & @CRLF _
					&"Press Ctrl + q to terminate Auto Pot" & @CRLF _
					& @CRLF _
					&"News:" & @CRLF _
					&"+ Can be use " & $att_nums & " skill attack and " & $buff_nums & " skill buff" & @CRLF _
					&"+ Can be use two skill tables like F1 and F2" & @CRLF _
					& @CRLF _
					&"Errors:" & @CRLF _
					&"+ Also this autoPot have error with auto use skill when you click a NPC" & @CRLF _
					&"+ Some time, autoPot get error with change from window mode to full screen, you only can use auto pot and can't be use auto attack, this time you must reset autoPot or/and reset SRO" & @CRLF _
					&"+ And, this application use hook keyboard to send key to SRO, and when time of attack skill and buff skill run out, it will send key to SRO, so it is not intelligent enough for re-use skill when it miss or not try to send key to chat window, so please set the time of skill pass by 2 second and try not chat when buff or skill is in use" & @CRLF _
					&"+ And the last one, skill which is just use one time, it still avalble when you set it to the first skill list, it will do what you want ;)" & @CRLF _
					& @CRLF _
					&"==== Hope you all fun with SRO ====" & @CRLF _
					&"Author: Truong Son <teentitan1986@gmail.com>"
					
	; Make GUI:
	Local $gui_tab = GUICtrlCreateTab(5,5,310,300)
	
	; --------------------------------------------------------------------------
	; Tab AutoPot
	; --------------------------------------------------------------------------
	Local $gui_tab_autoPot = GUICtrlCreateTabItem("Auto Pot")
	
	$row_y = 35
	$gui_label_gp[0] = GuiCtrlCreateLabel("Auto use HP pot:", 20, $row_y)
	$row_y += 20
	Local $gui_label = GuiCtrlCreateLabel("Key:", 20, $row_y)
	Local $gui_combo_HP_key = GuiCtrlCreateCombo("", 50, $row_y,60)
	Local $gui_input_HP_deg = GuiCtrlCreateInput($HPdeg, 120, $row_y, 40)
	Local $gui_updown_HP_deg = GUICtrlCreateUpDown($gui_input_HP_deg)
	$gui_label = GuiCtrlCreateLabel("%", 170, $row_y, 10)
	$row_y += 30
	$gui_label_gp[1] = GuiCtrlCreateLabel("Auto use MP pot:", 20, $row_y)
	$row_y += 20
	$gui_label = GuiCtrlCreateLabel("Key:", 20, $row_y)
	Local $gui_combo_MP_key = GuiCtrlCreateCombo("", 50, $row_y, 60)
	Local $gui_input_MP_deg = GuiCtrlCreateInput($MPdeg, 120, $row_y, 40)
	Local $gui_updown_MP_deg = GUICtrlCreateUpDown($gui_input_MP_deg)
	$gui_label = GuiCtrlCreateLabel("%", 170, $row_y, 10)
	$row_y += 25
	Local $gui_check_Pill = GuiCtrlCreateCheckbox("Auto use Pill:", 20, $row_y,210)
	$row_y += 25
	$gui_label = GuiCtrlCreateLabel("Key:", 20, $row_y)
	Local $gui_combo_Pill_key = GuiCtrlCreateCombo("", 50, $row_y, 60)
	$row_y += 30
	Local $gui_check_autoLoot = GuiCtrlCreateCheckbox("Auto loot (pick up) item", 20, $row_y)
	$row_y += 30
	Local $gui_check_Heal = GuiCtrlCreateCheckbox("Auto use skill to restore HP", 20, $row_y)
	$row_y += 25
	$gui_label = GuiCtrlCreateLabel("Key:", 20, $row_y)
	Local $gui_combo_Heal_key = GuiCtrlCreateCombo("", 50, $row_y, 60)
	Local $gui_input_Heal_deg = GuiCtrlCreateInput($HPdegHeal, 120, $row_y, 40)
	Local $gui_updown_MP_deg = GUICtrlCreateUpDown($gui_input_Heal_deg)
	$gui_label = GuiCtrlCreateLabel("%", 170, $row_y, 10)
	
	; --------------------------------------------------------------------------
	; Tab AutoSkill
	; --------------------------------------------------------------------------
	Local $gui_tab_autoSkill = GUICtrlCreateTabItem("Auto Skill")
	
	$row_y = 35
	$gui_label_gp[2] = GuiCtrlCreateLabel("Auto use skill attack:", 20, $row_y)
	$row_y += 20
	$gui_label_gp[3] = GuiCtrlCreateLabel("Skill attack list:", 20, $row_y)
	$gui_label_gp[4] = GuiCtrlCreateLabel("Waiting time: (0 = just use 1 time)", 150, $row_y)
	For $i=0 To $att_nums-1
		$row_y += 30
		Local $gui_label = GuiCtrlCreateLabel("Skill " & ($i+1), 20, $row_y)
		$gui_combo_skill_key[$i] = GuiCtrlCreateCombo("", 70, $row_y, 60)
		$gui_input_skill_delay[$i] = GuiCtrlCreateInput($att_skill[$i][1], 160, $row_y, 60)
		$gui_updown_skill[$i] = GUICtrlCreateUpDown($gui_input_skill_delay[$i])
		$gui_label_gp[5] = GuiCtrlCreateLabel("ms", 230, $row_y)
	Next

	; --------------------------------------------------------------------------
	; Tab AutoBuff
	; --------------------------------------------------------------------------
	Local $gui_tab_autoBuff = GUICtrlCreateTabItem("Auto Buff")
	
	$row_y = 30
	Local $gui_check_autobuff = GUICtrlCreateCheckbox("Auto use skill buff:", 20, $row_y)
	$row_y += 25
	$gui_label_gp[6] = GuiCtrlCreateLabel("Skill buff list:", 20, $row_y,160)
	$gui_label_gp[7] = GuiCtrlCreateLabel("Waiting time: (0 = just use 1 time)", 150, $row_y)
	For $i=0 To $buff_nums-1
		$row_y += 30
		Local $gui_label = GuiCtrlCreateLabel("Skill " & ($i+1), 20, $row_y)
		$gui_combo_buff_key[$i] = GuiCtrlCreateCombo("", 70, $row_y, 60)
		$gui_input_buff_delay[$i] = GuiCtrlCreateInput($buff_skill[$i][1], 160, $row_y, 60)
		$gui_updown_buff[$i] = GUICtrlCreateUpDown($gui_input_buff_delay[$i])
		$gui_label_gp[8] = GuiCtrlCreateLabel("seconds", 230, $row_y)
	Next
	
	; --------------------------------------------------------------------------
	; Tab Help
	; --------------------------------------------------------------------------
	Local $gui_tab_Help = GUICtrlCreateTabItem("Help")
	
	Local $gui_edit_help = GUICtrlCreateEdit($gui_help_text, 20, 40, 280, 250, $ES_READONLY + $WS_VSCROLL)
	
	; --------------------------------------------------------------------------
	; End Tabs
	; --------------------------------------------------------------------------
	Local $gui_tab_end = GUICtrlCreateTabItem("")
	
	; --------------------------------------------------------------------------
	; Buttons
	; --------------------------------------------------------------------------
	Local $gui_butt_save = GUICtrlCreateButton("Save",20,310,70,35)
	Local $gui_butt_exit = GUICtrlCreateButton("Exit",220,310,70,35)
	
	#cs
	; Set font -----------------------------------------------------------------
	; who need to set font when use english ?
	For $i=0 To UBound($gui_label_gp)-1
		GUICtrlSetFont($gui_label_gp[$i], 6, 400, 0, "VK Sans Serif")
	Next
	GUICtrlSetFont($gui_check_Pill, 6, 400, 0, "VK Sans Serif")
	GUICtrlSetFont($gui_check_autoLoot, 6, 400, 0, "VK Sans Serif")
	GUICtrlSetFont($gui_check_Heal, 6, 400, 0, "VK Sans Serif")
	GUICtrlSetFont($gui_check_autobuff, 6, 400, 0, "VK Sans Serif")
	GUICtrlSetFont($gui_edit_help, 6, 400, 0, "VK Sans Serif")
	#ce
		
	; System config value ------------------------------------------------------
	$state_temp = _Iif($auto_loot == true,$GUI_CHECKED,$GUI_UNCHECKED)
	GUICtrlSetState($gui_check_autoLoot,$state_temp)
	$state_temp = _Iif($auto_pill == true,$GUI_CHECKED,$GUI_UNCHECKED)
	GUICtrlSetState($gui_check_Pill,$state_temp)
	$state_temp = _Iif($auto_heal == true,$GUI_CHECKED,$GUI_UNCHECKED)
	GUICtrlSetState($gui_check_Heal,$state_temp)
	$state_temp = _Iif($auto_buff == true,$GUI_CHECKED,$GUI_UNCHECKED)
	GUICtrlSetState($gui_check_autobuff,$state_temp)
	
	GUICtrlSetData($gui_combo_HP_key,$short_key_2,$keyHP)
	GUICtrlSetData($gui_combo_MP_key,$short_key_2,$keyMP)
	GUICtrlSetData($gui_combo_Pill_key,$short_key_2,$keyPill)
	GUICtrlSetData($gui_combo_Heal_key,$short_key_2,$keyHeal)
	
	For $i=0 To $att_nums-1
		GUICtrlSetData($gui_combo_skill_key[$i],$short_key_2,$att_skill[$i][0])
	Next
	For $i=0 To $buff_nums-1
		GUICtrlSetData($gui_combo_buff_key[$i],$short_key,$buff_skill[$i][0])
	Next
	
	GuiSetState(@SW_SHOW)
	
	While (1)
		
		$msg = GUIGetMsg()
		Select
			Case $msg = $gui_butt_save
				$auto_loot = (GUICtrlRead($gui_check_autoloot) = $GUI_CHECKED)
				$auto_pill = (GUICtrlRead($gui_check_Pill) = $GUI_CHECKED)
				$auto_heal = (GUICtrlRead($gui_check_Heal) = $GUI_CHECKED)
				$auto_buff = (GUICtrlRead($gui_check_autobuff) = $GUI_CHECKED)
				$auto_heal = (GUICtrlRead($gui_check_Heal) = $GUI_CHECKED)
				$keyHP = GUICtrlRead($gui_combo_HP_key)
				$keyMP = GUICtrlRead($gui_combo_MP_key)
				$keyPill = GUICtrlRead($gui_combo_Pill_key)
				$keyHeal = GUICtrlRead($gui_combo_Heal_key)
				$HPdeg = GUICtrlRead($gui_input_HP_deg)
				$MPdeg = GUICtrlRead($gui_input_MP_deg)
				$HPdegHeal = GUICtrlRead($gui_input_Heal_deg)

				For $i=0 To $att_nums-1
					$att_skill[$i][0] = GUICtrlRead($gui_combo_skill_key[$i])
					$att_skill[$i][1] = GUICtrlRead($gui_input_skill_delay[$i])
				Next
				
				For $i=0 To $buff_nums-1
					$buff_skill[$i][0] = GUICtrlRead($gui_combo_buff_key[$i])
					$buff_skill[$i][1] = GUICtrlRead($gui_input_buff_delay[$i])
				Next
				
				For $i=0 To ($att_nums - 1)
					$att_skill[$i][4] = TimerInit()
					$att_skill[$i][2] = 1
				Next
				
				For $i=0 To ($buff_nums - 1)
					$buff_skill[$i][4] = TimerInit()
					$buff_skill[$i][2] = 1
				Next

				writeIni() 
			Case $msg = $GUI_EVENT_CLOSE
				ExitLoop
			Case $msg = $gui_butt_exit
				terminateIt()
			EndSelect
			
		mainLoop()
	WEnd
	GUIDelete()
	;$gui_avail = False
	; Exit 0
EndFunc
 

توقيع : فدى الرسول
thxo.gif
 
معليش اخواني على الغيبة !!
مسافر + المنتدى متعطل !!!

قد أضع درس بعد شوي لأن عندي وقت فاضي !!

شكرا لكم ,,
والظاهر الإخوان مشغولين !!
 
تابع

وصناعة الـ Functions UDF

إعداد : Ashalshaikh
توقفنا عند عمل فانكشن تظهر اسمي !!

الدرس كبير بعض الشيء:y: :hh: حتى يكفي لوقت كثير :hh:

طيب الأن تقولون لي :ـ
كيف تقول إنها دالة ,, نعرف الدوال لها صيغ ومدخلات !!!!
:mad:
أقول أصبروا علي شوي ,,
هذا الدرس خاص لتعيين الصيغ أو مدخلات الدالة !! :y:


طيب الآن ماذا نفعل ؟!!
هيا لنجعلها بدل ما تظهر اسمي تظهر كلام إنت تحدده يعني تكون صيغة الدالة
كود:
WMsg(text)
نعمل التالي !!
ركز معي !!
كود:
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"Zyzoom.org"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"Ashalshaikh"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"FTX-1"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"فدى الرسول"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"القناص"[/COLOR][COLOR=#ff0000])[/COLOR]

[COLOR=#0000ff]Func[/COLOR] WMsg[COLOR=#ff0000]([/COLOR][COLOR=#aa0000]$Text[/COLOR][COLOR=#ff0000])[/COLOR]
    [COLOR=#000090]MsgBox[/COLOR] [COLOR=#ff0000]([/COLOR][COLOR=#ac00a9]0[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]""[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#aa0000]$Text[/COLOR][COLOR=#ff0000])[/COLOR]
[COLOR=#0000ff]EndFunc[/COLOR]

WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"HaMuDi"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"elawady"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"Zoro779"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"Lak3yony"[/COLOR][COLOR=#ff0000])[/COLOR]
ملاحظة ,, المتغيرات في الصيغ لا تحتاج إلى تعريف !! :smile:

طيب تقولون لي !!
إحنا عرفنا إن فيه صيغ افتراضية أو خيارات زائدة وهي التي تحاط بـ [] كيف أعملها ؟!!!
أقولكم ,, يلا خلينا نعمل شي مثل كذا !!!

ولنجعله مثلا هو عنوان الرسالة Title إن وضعت شي معناه سوف يكون العنوان
وإذا ما وضعت يصير Zyzoom.org أوتوماتيكي :hh:
يعني تكون الصيغة
كود:
WMsg ( "Text"[,"Title"])
ركز جدا !!! :mad:
كود:
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"Zyzoom.org"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"Ashalshaikh"[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]"درس صناعة الدوال "[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"FTX-1"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"فدى الرسول"[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]"منتديات زيزووووم"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"القناص"[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]"درس صناعة الدوال "[/COLOR][COLOR=#ff0000])[/COLOR]

[COLOR=#0000ff]Func[/COLOR] WMsg[COLOR=#ff0000]([/COLOR][COLOR=#aa0000]$Text[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#aa0000]$Title[/COLOR][COLOR=#ff0000]=[/COLOR][COLOR=#9999cc]"Zyzoom.org"[/COLOR][COLOR=#ff0000])[/COLOR]
    [COLOR=#000090]MsgBox[/COLOR] [COLOR=#ff0000]([/COLOR][COLOR=#ac00a9]0[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#aa0000]$Title[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#aa0000]$Text[/COLOR][COLOR=#ff0000])[/COLOR]
[COLOR=#0000ff]EndFunc[/COLOR]

WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"HaMuDi"[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]"درس صناعة الدوال "[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"elawady"[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]"منتديات زيزووووم"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"Zoro779"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"Lak3yony"[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]"منتديات زيزووووم"[/COLOR][COLOR=#ff0000])[/COLOR]
لاحظ !! :wink:

طيب تقولون لي نحن عرفنا دوال معدلة تقوم بالتعديل على نفس المدخلات ,, مثل دالة FileListToArray
تضع من ضمن المدخلات متغير ,, وهي تحوله لك إلى مصفوفة !!

سهلة جدا ,, أضف هذه الكلمة المفتاحية قبل المتغير في الصيغة ,,
ByRef
انظر للمثال :ـ
كود:
[COLOR=#aa0000]$EW[/COLOR] [COLOR=#ff0000]=[/COLOR] [COLOR=#ac00a9]8[/COLOR]
[COLOR=#000090]MsgBox[/COLOR] [COLOR=#ff0000]([/COLOR][COLOR=#ac00a9]0[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]""[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#aa0000]$EW[/COLOR][COLOR=#ff0000])[/COLOR]
Plus[COLOR=#ac00a9]4[/COLOR][COLOR=#ff0000]([/COLOR][COLOR=#aa0000]$EW[/COLOR][COLOR=#ff0000])[/COLOR]
[COLOR=#000090]MsgBox[/COLOR] [COLOR=#ff0000]([/COLOR][COLOR=#ac00a9]0[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]""[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#aa0000]$EW[/COLOR][COLOR=#ff0000])[/COLOR]



[COLOR=#0000ff]Func[/COLOR] Plus[COLOR=#ac00a9]4[/COLOR][COLOR=#ff0000]([/COLOR][COLOR=#0000ff]ByRef[/COLOR] [COLOR=#aa0000]$Num[/COLOR][COLOR=#ff0000])[/COLOR]
    [COLOR=#aa0000]$Num[/COLOR] [COLOR=#ff0000]=[/COLOR] [COLOR=#aa0000]$Num[/COLOR] [COLOR=#ff0000]+[/COLOR] [COLOR=#ac00a9]4[/COLOR]
[COLOR=#0000ff]EndFunc[/COLOR]
لاحظ شيئين !!
1) قمنا بعملية على المتغير $num داخل الدالة ,, مع مساواه له
كود:
$num = $Num +4
وهذا يؤدي إلى عمل نفس العملية على المتغير المقترن به في الخارج وهو $EW

2) لابد أن يكون المدخل متغير حتى يستطيع يغير فيه ,, وإلا ما يردك إلا الخطأ :hh:


شكرا لكم !!

الدرس الجاي رح يكون عن تعيين المخرجات !!
Returns + @Error + @Extended
حتى تكون دالة كاملة :ok:


أريد كل واحد يعمل لنا دالة على كيف كيفه !! :ok:
كتطبيق وأعرف إن الشرح مفهوم !!
وإلا سأغير أسلوب الكتابة !! :b:
 
تقصد أنها تختفي ,,
مثل السابق انتبهت لهذا الخطأ حاولت أصلحه ولكن ما قدرت ,, :q:
ماهي مشكلة السبب بسيط وهو أن الخلفية صورة ,, سأزيلها إن اضطررت ,,
إذا عندك حل أسعفني به :smile: لأني فعلا أحتاجه :smile:
شكرا لك !! وجزاك الله ألف خير !!

ابشرك قعدت العب في كودا وعرفت الحل >>> بدري :d:

اضغط على الصورة اللي في الفورم بالزر اليمين

تلقى Tab Order

وراح تطلع لك كل الادوات اختار اداة الصورة ونزلها اخر شي

وان شاء الله تضبط ( عانيت من نفس المشكلة و الحمد لله انحلت )
 
تابع

وصناعة الـ Functions UDF

إعداد : Ashalshaikh
توقفنا عند عمل فانكشن تظهر اسمي !!

الدرس كبير بعض الشيء:y: :hh: حتى يكفي لوقت كثير :hh:

طيب الأن تقولون لي :ـ
كيف تقول إنها دالة ,, نعرف الدوال لها صيغ ومدخلات !!!!
:mad:
أقول أصبروا علي شوي ,,
هذا الدرس خاص لتعيين الصيغ أو مدخلات الدالة !! :y:


طيب الآن ماذا نفعل ؟!!
هيا لنجعلها بدل ما تظهر اسمي تظهر كلام إنت تحدده يعني تكون صيغة الدالة
كود:
WMsg(text)
نعمل التالي !!
ركز معي !!
كود:
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"Zyzoom.org"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"Ashalshaikh"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"FTX-1"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"فدى الرسول"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"القناص"[/COLOR][COLOR=#ff0000])[/COLOR]

[COLOR=#0000ff]Func[/COLOR] WMsg[COLOR=#ff0000]([/COLOR][COLOR=#aa0000]$Text[/COLOR][COLOR=#ff0000])[/COLOR]
    [COLOR=#000090]MsgBox[/COLOR] [COLOR=#ff0000]([/COLOR][COLOR=#ac00a9]0[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]""[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#aa0000]$Text[/COLOR][COLOR=#ff0000])[/COLOR]
[COLOR=#0000ff]EndFunc[/COLOR]

WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"HaMuDi"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"elawady"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"Zoro779"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"Lak3yony"[/COLOR][COLOR=#ff0000])[/COLOR]
ملاحظة ,, المتغيرات في الصيغ لا تحتاج إلى تعريف !! :smile:

طيب تقولون لي !!
إحنا عرفنا إن فيه صيغ افتراضية أو خيارات زائدة وهي التي تحاط بـ [] كيف أعملها ؟!!!
أقولكم ,, يلا خلينا نعمل شي مثل كذا !!!

ولنجعله مثلا هو عنوان الرسالة Title إن وضعت شي معناه سوف يكون العنوان
وإذا ما وضعت يصير Zyzoom.org أوتوماتيكي :hh:
يعني تكون الصيغة
كود:
WMsg ( "Text"[,"Title"])
ركز جدا !!! :mad:
كود:
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"Zyzoom.org"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"Ashalshaikh"[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]"درس صناعة الدوال "[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"FTX-1"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"فدى الرسول"[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]"منتديات زيزووووم"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"القناص"[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]"درس صناعة الدوال "[/COLOR][COLOR=#ff0000])[/COLOR]

[COLOR=#0000ff]Func[/COLOR] WMsg[COLOR=#ff0000]([/COLOR][COLOR=#aa0000]$Text[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#aa0000]$Title[/COLOR][COLOR=#ff0000]=[/COLOR][COLOR=#9999cc]"Zyzoom.org"[/COLOR][COLOR=#ff0000])[/COLOR]
    [COLOR=#000090]MsgBox[/COLOR] [COLOR=#ff0000]([/COLOR][COLOR=#ac00a9]0[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#aa0000]$Title[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#aa0000]$Text[/COLOR][COLOR=#ff0000])[/COLOR]
[COLOR=#0000ff]EndFunc[/COLOR]

WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"HaMuDi"[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]"درس صناعة الدوال "[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"elawady"[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]"منتديات زيزووووم"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"Zoro779"[/COLOR][COLOR=#ff0000])[/COLOR]
WMsg[COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"Lak3yony"[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]"منتديات زيزووووم"[/COLOR][COLOR=#ff0000])[/COLOR]
لاحظ !! :wink:

طيب تقولون لي نحن عرفنا دوال معدلة تقوم بالتعديل على نفس المدخلات ,, مثل دالة FileListToArray
تضع من ضمن المدخلات متغير ,, وهي تحوله لك إلى مصفوفة !!

سهلة جدا ,, أضف هذه الكلمة المفتاحية قبل المتغير في الصيغة ,,
ByRef
انظر للمثال :ـ
كود:
[COLOR=#aa0000]$EW[/COLOR] [COLOR=#ff0000]=[/COLOR] [COLOR=#ac00a9]8[/COLOR]
[COLOR=#000090]MsgBox[/COLOR] [COLOR=#ff0000]([/COLOR][COLOR=#ac00a9]0[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]""[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#aa0000]$EW[/COLOR][COLOR=#ff0000])[/COLOR]
Plus[COLOR=#ac00a9]4[/COLOR][COLOR=#ff0000]([/COLOR][COLOR=#aa0000]$EW[/COLOR][COLOR=#ff0000])[/COLOR]
[COLOR=#000090]MsgBox[/COLOR] [COLOR=#ff0000]([/COLOR][COLOR=#ac00a9]0[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]""[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#aa0000]$EW[/COLOR][COLOR=#ff0000])[/COLOR]



[COLOR=#0000ff]Func[/COLOR] Plus[COLOR=#ac00a9]4[/COLOR][COLOR=#ff0000]([/COLOR][COLOR=#0000ff]ByRef[/COLOR] [COLOR=#aa0000]$Num[/COLOR][COLOR=#ff0000])[/COLOR]
    [COLOR=#aa0000]$Num[/COLOR] [COLOR=#ff0000]=[/COLOR] [COLOR=#aa0000]$Num[/COLOR] [COLOR=#ff0000]+[/COLOR] [COLOR=#ac00a9]4[/COLOR]
[COLOR=#0000ff]EndFunc[/COLOR]
لاحظ شيئين !!
1) قمنا بعملية على المتغير $num داخل الدالة ,, مع مساواه له
كود:
$num = $Num +4
وهذا يؤدي إلى عمل نفس العملية على المتغير المقترن به في الخارج وهو $EW

2) لابد أن يكون المدخل متغير حتى يستطيع يغير فيه ,, وإلا ما يردك إلا الخطأ :hh:


شكرا لكم !!

الدرس الجاي رح يكون عن تعيين المخرجات !!
Returns + @Error + @Extended
حتى تكون دالة كاملة :ok:


أريد كل واحد يعمل لنا دالة على كيف كيفه !! :ok:
كتطبيق وأعرف إن الشرح مفهوم !!
وإلا سأغير أسلوب الكتابة !! :b:

هذا UDF سويته من زماااااااااااااااااااااااااااااااااااااان

للتحميل او الابديت

كود:
[COLOR=#0000ff]Func[/COLOR] Download[COLOR=#ff0000]([/COLOR][COLOR=#aa0000]$URL[/COLOR] [COLOR=#ff0000],[/COLOR] [COLOR=#aa0000]$FileName[/COLOR][COLOR=#ff0000])[/COLOR]
    [COLOR=#aa0000]$FileSize[/COLOR] [COLOR=#ff0000]=[/COLOR] [COLOR=#000090]InetGetSize[/COLOR][COLOR=#ff0000]([/COLOR][COLOR=#aa0000]$URL[/COLOR][COLOR=#ff0000])[/COLOR]

    [COLOR=#000090]InetGet[/COLOR][COLOR=#ff0000]([/COLOR][COLOR=#aa0000]$URL[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#aa0000]$FileName[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#ac00a9]0[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#ac00a9]1[/COLOR][COLOR=#ff0000])[/COLOR]

    [COLOR=#000090]ProgressOn[/COLOR][COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"التحميل"[/COLOR][COLOR=#ff0000],[/COLOR] [COLOR=#9999cc]"جاري التحميل"[/COLOR][COLOR=#ff0000],[/COLOR] [COLOR=#9999cc]""[/COLOR][COLOR=#ff0000])[/COLOR]
    [COLOR=#0000ff]While[/COLOR] [COLOR=#ff33ff]@InetGetActive[/COLOR]
        [COLOR=#aa0000]$Percentage[/COLOR] [COLOR=#ff0000]=[/COLOR] [COLOR=#ff33ff]@InetGetBytesRead[/COLOR] [COLOR=#ff0000][COLOR=#ff0000]*[/COLOR][/COLOR] [COLOR=#ac00a9]1[/COLOR][COLOR=#ac00a9]0[/COLOR][COLOR=#ac00a9]0[/COLOR] [COLOR=#ff0000]/[/COLOR] [COLOR=#aa0000]$FileSize[/COLOR]
        [COLOR=#000090]ProgressSet[/COLOR][COLOR=#ff0000]([/COLOR][COLOR=#aa0000]$Percentage[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]"اكتمل "[/COLOR] [COLOR=#ff0000]&[/COLOR] [COLOR=#ff33ff]@InetGetBytesRead[/COLOR] [COLOR=#ff0000]&[/COLOR] [COLOR=#9999cc]" من "[/COLOR] [COLOR=#ff0000]&[/COLOR] [COLOR=#aa0000]$FileSize[/COLOR] [COLOR=#ff0000]&[/COLOR] [COLOR=#9999cc]" بايت"[/COLOR][COLOR=#ff0000],[/COLOR] [COLOR=#aa0000]$FileName[/COLOR] [COLOR=#ff0000]&[/COLOR] [COLOR=#9999cc]" جاري تحميل"[/COLOR][COLOR=#ff0000])[/COLOR]
        [COLOR=#000090]Sleep[/COLOR][COLOR=#ff0000]([/COLOR][COLOR=#ac00a9]1[/COLOR][COLOR=#ff0000])[/COLOR]
    [COLOR=#0000ff]WEnd[/COLOR]
    [COLOR=#000090]ProgressOff[/COLOR][COLOR=#ff0000]([/COLOR][COLOR=#ff0000])[/COLOR]
[COLOR=#0000ff]EndFunc[/COLOR]
 
wh_79497025.gif


يسلمو علي المجهود
23jp5.gif

i-048.gif

يعطيك الف عافيه

wh_51007632.gif
 
i-048.gif

يعطيك الف عافيه
 
توقيع : shaapan
ابشرك قعدت العب في كودا وعرفت الحل >>> بدري :d:

اضغط على الصورة اللي في الفورم بالزر اليمين

تلقى Tab Order

وراح تطلع لك كل الادوات اختار اداة الصورة ونزلها اخر شي

وان شاء الله تضبط ( عانيت من نفس المشكلة و الحمد لله انحلت )
فعلا معاك حق !!
انحلت المشكلة :y:
أشكرك أخي ,, أشكرك أشد الشكر !! :b:
إن شاء الله خير !!
 
هذا UDF سويته من زماااااااااااااااااااااااااااااااااااااان

للتحميل او الابديت

كود:
[COLOR=#0000ff]Func[/COLOR] Download[COLOR=#ff0000]([/COLOR][COLOR=#aa0000]$URL[/COLOR] [COLOR=#ff0000],[/COLOR] [COLOR=#aa0000]$FileName[/COLOR][COLOR=#ff0000])[/COLOR]
    [COLOR=#aa0000]$FileSize[/COLOR] [COLOR=#ff0000]=[/COLOR] [COLOR=#000090]InetGetSize[/COLOR][COLOR=#ff0000]([/COLOR][COLOR=#aa0000]$URL[/COLOR][COLOR=#ff0000])[/COLOR]

    [COLOR=#000090]InetGet[/COLOR][COLOR=#ff0000]([/COLOR][COLOR=#aa0000]$URL[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#aa0000]$FileName[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#ac00a9]0[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#ac00a9]1[/COLOR][COLOR=#ff0000])[/COLOR]

    [COLOR=#000090]ProgressOn[/COLOR][COLOR=#ff0000]([/COLOR][COLOR=#9999cc]"التحميل"[/COLOR][COLOR=#ff0000],[/COLOR] [COLOR=#9999cc]"جاري التحميل"[/COLOR][COLOR=#ff0000],[/COLOR] [COLOR=#9999cc]""[/COLOR][COLOR=#ff0000])[/COLOR]
    [COLOR=#0000ff]While[/COLOR] [COLOR=#ff33ff]@InetGetActive[/COLOR]
        [COLOR=#aa0000]$Percentage[/COLOR] [COLOR=#ff0000]=[/COLOR] [COLOR=#ff33ff]@InetGetBytesRead[/COLOR] [COLOR=#ff0000][COLOR=#ff0000]*[/COLOR][/COLOR] [COLOR=#ac00a9]1[/COLOR][COLOR=#ac00a9]0[/COLOR][COLOR=#ac00a9]0[/COLOR] [COLOR=#ff0000]/[/COLOR] [COLOR=#aa0000]$FileSize[/COLOR]
        [COLOR=#000090]ProgressSet[/COLOR][COLOR=#ff0000]([/COLOR][COLOR=#aa0000]$Percentage[/COLOR][COLOR=#ff0000],[/COLOR][COLOR=#9999cc]"اكتمل "[/COLOR] [COLOR=#ff0000]&[/COLOR] [COLOR=#ff33ff]@InetGetBytesRead[/COLOR] [COLOR=#ff0000]&[/COLOR] [COLOR=#9999cc]" من "[/COLOR] [COLOR=#ff0000]&[/COLOR] [COLOR=#aa0000]$FileSize[/COLOR] [COLOR=#ff0000]&[/COLOR] [COLOR=#9999cc]" بايت"[/COLOR][COLOR=#ff0000],[/COLOR] [COLOR=#aa0000]$FileName[/COLOR] [COLOR=#ff0000]&[/COLOR] [COLOR=#9999cc]" جاري تحميل"[/COLOR][COLOR=#ff0000])[/COLOR]
        [COLOR=#000090]Sleep[/COLOR][COLOR=#ff0000]([/COLOR][COLOR=#ac00a9]1[/COLOR][COLOR=#ff0000])[/COLOR]
    [COLOR=#0000ff]WEnd[/COLOR]
    [COLOR=#000090]ProgressOff[/COLOR][COLOR=#ff0000]([/COLOR][COLOR=#ff0000])[/COLOR]
[COLOR=#0000ff]EndFunc[/COLOR]
رائع رائع رائع رائع ,,
تطبيق منتااااااااااااااااااااااااااااااااااااااااااااااااااااااااااااااز :ok:
ودالة رائعة !!!
إن شاء الله رح نعتمدها في مشروع ,, حتى نطورها دالة كاملة وشاملة !! ونتعلم في نفس الوقت !! :ok:

يسلم بؤش << بؤك :d::d::d:

شكرا لك
 
رائع رائع رائع رائع ,,
تطبيق منتااااااااااااااااااااااااااااااااااااااااااااااااااااااااااااااز :ok:
ودالة رائعة !!!
إن شاء الله رح نعتمدها في مشروع ,, حتى نطورها دالة كاملة وشاملة !! ونتعلم في نفس الوقت !! :ok:

يسلم بؤش << بؤك :d::d::d:

شكرا لك

شكلك كنت تتابع بيني وبينك :d:
 
بارك الله فيك
 
مرحبا اخ احمد كيف حالك

مشكوور يابعدي .., على الدرس ومشكوور على ألجهوود الي تبذلها


والله لا يضيع لك تعب انشالله

انا فهمت الدرس تسعه وتسعين بالميه

وسويت تطبيقين على السريع ... بس عشاان ابين لك انك استاذ وتوصل االمعلومه لـ اي شخص


كود:
mar("mar.txt")

Func mar($path)
	$t=FileGetSize($path)
	$s=FileGetShortName($path)
	MsgBox(0,"","معلومات المف"& @CRLF  &"حجم الملف:"&$t & @CRLF & "اسم الملف:"& $s )
EndFunc

-------------------------------------------- ex2---------------------------------



وتطبيقي الثاني فكرته يخرج الجذر لي الرقم

انا استخدمت رقم اربعه هنا سوف يخرج الناتج عدد صحيح

اما اذ ادخلت رقم ويكون الناتج عدد غير صحيح تخرج مسج بوكس تخبر المستخدم بان العمليه ليس له عدد صحيح او جذر


<----- ادري ا نه تطبيق عادي بس حبيت ابين لك اني فااهم وانك شخص قاادر على ايصاال المعلومه



كود:
 $m=4
 Sqrtv($m)
 
 func sqrtv( byref $num)
    $number=sqrt($num)
    if StringIsFloat ($number) Then
        MsgBox(0,""," لا يوجد عدد صحيح لعمليه الجذر  ")
    Else
        MsgBox(0,"",$number)
    EndIf
    EndFunc



بيض الله وجهك اخوووي

وعسااك على القووه


ونننتظر جديدك يابعدي

 
بسم الله و الصلاة و السلام على رسول الله صلى عيه ربي و سلم تسليما كثيرا أما بعد السلام عليكم و رحمة الله و بركاته فأنا لم أفهم طريقة عمل
AutoIt 3 Script

لأني أعرف طريقة العمل على الدلفي و السي ++ و ما إلى دلك فمثلا طريقة العمل على الدلفي هي صناعة واجهة للبرنامج ثم إعطاء أمر لكل شيئ في تلك الواجهة و لكن في ال
AutoIt 3 Script


لا أظنني أجد هده الخاصية

أمنوا على دعائي و قولوه حينما تنغلق أدهانكم و تحسون أنك لا تفهمون شيئا بارك الله فيكم فقد كان يفعل هدا شيخ الإسلام رحمه الله عندما لا يفهم شيئا في كتاب الله
"اللهم يا معلم إبرهيم علمني و يا مفهم سليمان فهمني"
و السلام عليكم و رحمة الله و بركاته

 
توقيع : mehdidois
أحبائي اعذرووووني على الغيبة :b::b: المنتدى يتعطل ويتصلح (يلعب :mad: ) عندي !! :no:
شكلك كنت تتابع بيني وبينك :d:
:d::d::d:
مرحبا اخ احمد كيف حالك

مشكوور يابعدي .., على الدرس ومشكوور على ألجهوود الي تبذلها


والله لا يضيع لك تعب انشالله

انا فهمت الدرس تسعه وتسعين بالميه

وسويت تطبيقين على السريع ... بس عشاان ابين لك انك استاذ وتوصل االمعلومه لـ اي شخص


كود:
mar("mar.txt")

Func mar($path)
    $t=FileGetSize($path)
    $s=FileGetShortName($path)
    MsgBox(0,"","معلومات المف"& @CRLF  &"حجم الملف:"&$t & @CRLF & "اسم الملف:"& $s )
EndFunc
-------------------------------------------- ex2---------------------------------



وتطبيقي الثاني فكرته يخرج الجذر لي الرقم

انا استخدمت رقم اربعه هنا سوف يخرج الناتج عدد صحيح

اما اذ ادخلت رقم ويكون الناتج عدد غير صحيح تخرج مسج بوكس تخبر المستخدم بان العمليه ليس له عدد صحيح او جذر


<----- ادري ا نه تطبيق عادي بس حبيت ابين لك اني فااهم وانك شخص قاادر على ايصاال المعلومه



كود:
 $m=4
 Sqrtv($m)
 
 func sqrtv( byref $num)
    $number=sqrt($num)
    if StringIsFloat ($number) Then
        MsgBox(0,""," لا يوجد عدد صحيح لعمليه الجذر  ")
    Else
        MsgBox(0,"",$number)
    EndIf
    EndFunc
بيض الله وجهك اخوووي

وعسااك على القووه


ونننتظر جديدك يابعدي

ياااااااا أهلا ويا سهلا !!
الله يسلمك ويخليك أخي !!
ما شاء الله ,,
بالعكس التطبيق ماهو بسيط !!! تعرف إن دالة الجذر التربيعي ما أعرفها :d: ,, جزاك الله خير !!
يا مبدع !!
ولكن ودي أقولك شي بسيييييييط !!
بخصوص التطبيق الثاني
العبارة ByRef تعني أن العمليات التي تجري داخل الـ Func ستجرب في الحقيقة على المتغير !!
لاحظ:ـ
كود:
$D = 4
Plus($D)
MsgBox(0, '', $D)


Func Plus(ByRef $Num)
    $Num = $Num + 1
EndFunc   ;==>Plus
تغيرت قيمة المتغير $D نتيجة لتغيره بداخل الدالة !!
أحسنت ,, إنت فاهم 99.9999999999999999%

الله يسلمك , ويخليك ,, ويجزاك ألف خير !!
سلمت يمناك ..
بسم الله و الصلاة و السلام على رسول الله صلى عيه ربي و سلم تسليما كثيرا أما بعد السلام عليكم و رحمة الله و بركاته فأنا لم أفهم طريقة عمل
AutoIt 3 Script

لأني أعرف طريقة العمل على الدلفي و السي ++ و ما إلى دلك فمثلا طريقة العمل على الدلفي هي صناعة واجهة للبرنامج ثم إعطاء أمر لكل شيئ في تلك الواجهة و لكن في ال
AutoIt 3 Script


لا أظنني أجد هده الخاصية

أمنوا على دعائي و قولوه حينما تنغلق أدهانكم و تحسون أنك لا تفهمون شيئا بارك الله فيكم فقد كان يفعل هدا شيخ الإسلام رحمه الله عندما لا يفهم شيئا في كتاب الله
"اللهم يا معلم إبرهيم علمني و يا مفهم سليمان فهمني"
و السلام عليكم و رحمة الله و بركاته


وعليكم السلام ,, أهلا ومرحبا بك أخي الغالي !!
آمين آخي ,, أسأل الله أن يعلمك مالم تكن تعلم ,,,

أولا :: نصيحة مني لك !! بما إنك تفهم في الدلفي والـ C++ ,,, أحسن لك ,, امحي فكرة Autoit من تفكيرك :smile:
الأوتيت حل جيد لمن لا يفهم في البرمجة (مثلي):d: ,, وليس للمبرمجين (أمثالك) :ok: ,,
لن تجد مبتغاك في Autoit لأن AutoIt لا تقارن بالنسبة للدلفي أو C++ :d:

ثانيا :: كجواب لسؤالك ,, حتى لا يذهب الوقت بلا فائدة !!
يتم عمل الواجهة عن طريق دوال GUI وتعين الأبعاد بواسطة البيكسل ,, وجميع الخيارات عن طريق الأكواد :d: ,,

شكرا لك !!

بعد قليل درس ضبط المخرجات :y:
 
تابع

الـ UDF وصناعة الـ Function
إعداد : Ashalshaikh


السلام عليكم ,,
صلى على النبي عليه السلام .

تعلمنا في السابق كيف نضبط المدخلات !! :d:
الآن لنضبط المخرجات !! :smile:


المخرجات ثلاثة أنواع :ـ

@Error
@Extended

Returns أولا ::

وهي التي ترجع مباشرة في متغير أو مكان الكتابة !!
وهي ترجع النصوص أو الأرقام أو جميع أنواع البيانات .
Returns
مثلا :ـ
كود:
$D = StringLen ("Ashalshaikh")
MsgBox (0,"","Letters Number" & $D)
نلاحظ أن الدالة StringLen أرجعت عدد الحروف في المتغير $D عن طريقReturns

كيف يتم إرجاع الـ Returns
فقط بنفس العبارة :d:
Return Text
لنعمل الآن دالة تعمل Return
كود:
[/SIZE] [/FONT][FONT=Times New Roman][SIZE=3][COLOR=#aa0000]$DD[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000]=[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3] Plus[/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000]([/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ac00a9]5[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000])[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT] [FONT=Times New Roman][SIZE=3][COLOR=#000090]MsgBox[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000]([/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ac00a9]0[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000],[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#9999cc]''[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000],[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#aa0000]$DD[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000])[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]


[/SIZE][/FONT][SIZE=3]   [/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#0000ff]Func[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3] Plus[/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000]([/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#aa0000]$Num[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000])[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
    [/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#aa0000]$Num[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000]=[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#aa0000]$Num[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000]+[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ac00a9]1[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
    [/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#0000ff]Return[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#aa0000]$Num[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT] [FONT=Times New Roman][SIZE=3][COLOR=#0000ff]EndFunc[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#009933];==>Plus  [/COLOR][/SIZE][/FONT][SIZE=3]
ملحوظة ,, مهمة جدا جدا جدا جدا جدا ,,

الدالة تنتهي عند الكلمة المفتاحية Return
بمعنى أي شيء آخر بعد تنفيذ Return لن يوصل إليه !!
مثلا
كود:
  [/SIZE][/B][/FONT][B][FONT=Times New Roman][SIZE=3][COLOR=#aa0000]$DD[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000]=[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3] Plus[/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000]([/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ac00a9]5[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000])[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000090]MsgBox[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000]([/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ac00a9]0[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000],[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#9999cc]''[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000],[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#aa0000]$DD[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000])[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]


[/SIZE][/FONT][SIZE=3]   [/SIZE][FONT=Times New Roman][SIZE=3][COLOR=#0000ff]Func[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3] Plus[/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000]([/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#aa0000]$Num[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000])[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
    [/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#aa0000]$Num[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000]=[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#aa0000]$Num[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000]+[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ac00a9]1[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
    [/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#0000ff]Return[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ac00a9]0[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
    [/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#000090]MsgBox[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000]([/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ac00a9]0[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000],[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#9999cc]""[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000],[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#9999cc]""[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#ff0000])[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3]
[/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#0000ff]EndFunc[/COLOR][/SIZE][/FONT][FONT=Times New Roman][SIZE=3][COLOR=#009933];==>Plus  [/COLOR][/SIZE][/FONT][SIZE=3]
إذا لم يوضع قيمة للـ Return
ستكون تلقائيا 0

ثانيا :ـ
@Extended
يحتمل الأرقام فقط !!
عن طريق الدالة !!
SetExtended
مثال
كود:
كود:
[FONT=Times New Roman][COLOR=#aa0000]$DD[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]=[/COLOR][/FONT][FONT=Times New Roman] Plus[/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]5[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]
[/FONT] [FONT=Times New Roman][COLOR=#000090]MsgBox[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]0[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000],[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff33ff]@extended[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000],[/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$DD[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]


[/FONT]   [FONT=Times New Roman][COLOR=#0000ff]Func[/COLOR][/FONT][FONT=Times New Roman] Plus[/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]
    [/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]=[/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]+[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]1[/COLOR][/FONT][FONT=Times New Roman]
    [/FONT][FONT=Times New Roman][COLOR=#000090]SetExtended[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]5[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]
    [/FONT][FONT=Times New Roman][COLOR=#0000ff]Return[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]0[/COLOR][/FONT][FONT=Times New Roman]
[/FONT] [FONT=Times New Roman][COLOR=#0000ff]EndFunc[/COLOR][/FONT][FONT=Times New Roman][COLOR=#009933];==>Plus  [/COLOR][/FONT]
بإمكانك عمل الـ Return والـ Extended بنفس السطر :d:
انظر
كود:
  [/FONT][FONT=Times New Roman][COLOR=#aa0000]$DD[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]=[/COLOR][/FONT][FONT=Times New Roman] Plus[/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]5[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]
[/FONT] [FONT=Times New Roman][COLOR=#000090]MsgBox[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]0[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000],[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff33ff]@extended[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000],[/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$DD[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]


[/FONT]   [FONT=Times New Roman][COLOR=#0000ff]Func[/COLOR][/FONT][FONT=Times New Roman] Plus[/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]
    [/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]=[/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]+[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]1[/COLOR][/FONT][FONT=Times New Roman]
    [/FONT][FONT=Times New Roman][COLOR=#0000ff]Return[/COLOR][/FONT][FONT=Times New Roman][COLOR=#000090]SetExtended[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]5[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000],[/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]
[/FONT] [FONT=Times New Roman][COLOR=#0000ff]EndFunc[/COLOR][/FONT][FONT=Times New Roman][COLOR=#009933];==>Plus  [/COLOR][/FONT]
وذلك بشرط وضع قيمة للـ Returns داخل SetExtended !!
وإلا فالطريقة الأولى !! :smile:

ثالثا :ـ
@Error
عن طريق الدالة
SetError
انظر للمثال :ـ
كود:
  [/FONT][FONT=Times New Roman][COLOR=#aa0000]$DD[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]=[/COLOR][/FONT][FONT=Times New Roman] Plus[/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]8[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]
[/FONT] [FONT=Times New Roman][COLOR=#000090]MsgBox[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]0[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000],[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff33ff]@error[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000],[/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$DD[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]


[/FONT]   [FONT=Times New Roman][COLOR=#0000ff]Func[/COLOR][/FONT][FONT=Times New Roman] Plus[/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]
    [/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]=[/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]+[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]1[/COLOR][/FONT][FONT=Times New Roman]
    [/FONT][FONT=Times New Roman][COLOR=#000090]SetErrOr[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]5[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]
    [/FONT][FONT=Times New Roman][COLOR=#0000ff]Return[/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman]
[/FONT] [FONT=Times New Roman][COLOR=#0000ff]EndFunc[/COLOR][/FONT][FONT=Times New Roman][COLOR=#009933];==>Plus  [/COLOR][/FONT]
يمكن عمل قيمة للـ Extended بـ SetError
انظر
كود:
[/FONT][FONT=Times New Roman][COLOR=#aa0000]$DD[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]=[/COLOR][/FONT][FONT=Times New Roman] Plus[/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]8[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]
[/FONT] [FONT=Times New Roman][COLOR=#000090]MsgBox[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]0[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000],[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff33ff]@error[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]&[/COLOR][/FONT][FONT=Times New Roman][COLOR=#9999cc]"      "[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]&[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff33ff]@extended[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000],[/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$DD[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]


[/FONT]   [FONT=Times New Roman][COLOR=#0000ff]Func[/COLOR][/FONT][FONT=Times New Roman] Plus[/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]
    [/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]=[/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]+[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]1[/COLOR][/FONT][FONT=Times New Roman]
    [/FONT][FONT=Times New Roman][COLOR=#000090]SetErrOr[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]5[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000],[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]2[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]
    [/FONT][FONT=Times New Roman][COLOR=#0000ff]Return[/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman]
[/FONT] [FONT=Times New Roman][COLOR=#0000ff]EndFunc[/COLOR][/FONT][FONT=Times New Roman][COLOR=#009933];==>Plus  [/COLOR][/FONT]
يمكنك عمل قيمة للـ Return بـ SetError
كود:
كود:
 [FONT=Times New Roman][COLOR=#aa0000]$DD[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]=[/COLOR][/FONT][FONT=Times New Roman] Plus[/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]8[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]
[/FONT] [FONT=Times New Roman][COLOR=#000090]MsgBox[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]0[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000],[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff33ff]@error[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]&[/COLOR][/FONT][FONT=Times New Roman][COLOR=#9999cc]"      "[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]&[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff33ff]@extended[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000],[/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$DD[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]


[/FONT]   [FONT=Times New Roman][COLOR=#0000ff]Func[/COLOR][/FONT][FONT=Times New Roman] Plus[/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]
    [/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]=[/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]+[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]1[/COLOR][/FONT][FONT=Times New Roman]
    [/FONT][FONT=Times New Roman][COLOR=#0000ff]Return[/COLOR][/FONT][FONT=Times New Roman][COLOR=#000090]SetErrOr[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000]([/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]5[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000],[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ac00a9]2[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000],[/COLOR][/FONT][FONT=Times New Roman][COLOR=#aa0000]$Num[/COLOR][/FONT][FONT=Times New Roman][COLOR=#ff0000])[/COLOR][/FONT][FONT=Times New Roman]
[/FONT] [FONT=Times New Roman][COLOR=#0000ff]EndFunc[/COLOR][/FONT][FONT=Times New Roman][COLOR=#009933];==>Plus  [/COLOR][/FONT]
بشرط عمل قيمة للـ Return وإلا فالطريقة الأولى أو الثانية ,,

إذا تكون صيغة الدالة SertError
كود:
SetError (ErrorCode[ , ExtendedCode [, Returns ]])

أعتذر شباب ,,
إذا كان الدرس غير مفهوم :b:
عملته باستعجال ,,
إذا كان غير مفهوم ,, سأعمل درس آخر !! :smile:
شكرا لكم ,,

أتمنى أشوف تطبيقاتكم :d:
 
ياااااااااااااااااااااااااااااااه
الموضوع نايم إلى هذي الدرجة !!
أنا فعلا محبط !!
 
ياااااااااااااااااااااااااااااااه
الموضوع نايم إلى هذي الدرجة !!
أنا فعلا محبط !!

السلام عليكم ورحمت الله وبركاته
والله ياشيخ انت اللى نسيت الموضوع
ونسيتنا معاه , فكل المشتركين لما كانوا بيدخلوا ومش بيلاقوا دروس أو شروحات كل مره اكيد بيحصل لهم احباط نفس اللى عندك دلوقتى
فى مثل مصرى بيقول ( لية تكلف نفسك فى طبخه وتصرف عليها فلوس كتير وتيجى علشان زره ملح تخرب الطبخة ):no:

هذا نفس اللى حدث انت كلفت الموضوع ومشيت معانا خطوة خطوه وفى نصف الطريق تركتنا
وقلت الجا الى كتاب الشرح المرفق مع البرنامج :cr:

انا عن نفسى زعلت جدااااا منك على هذا :er::er::er::er::er:
لان اللى بيحب واحد قوى بينجرح منه اوى اوى اوى (بالمصرى :er:)
والله المستعان
 
توقيع : فدى الرسول
السلام عليكم ورحمت الله وبركاته
والله ياشيخ انت اللى نسيت الموضوع
ونسيتنا معاه , فكل المشتركين لما كانوا بيدخلوا ومش بيلاقوا دروس أو شروحات كل مره اكيد بيحصل لهم احباط نفس اللى عندك دلوقتى
فى مثل مصرى بيقول ( لية تكلف نفسك فى طبخه وتصرف عليها فلوس كتير وتيجى علشان زره ملح تخرب الطبخة ):no:

هذا نفس اللى حدث انت كلفت الموضوع ومشيت معانا خطوة خطوه وفى نصف الطريق تركتنا
وقلت الجا الى كتاب الشرح المرفق مع البرنامج :cr:

انا عن نفسى زعلت جدااااا منك على هذا :er::er::er::er::er:
لان اللى بيحب واحد قوى بينجرح منه اوى اوى اوى (بالمصرى :er:)
والله المستعان
وعليكم السلام ,,
شكرا لك أخي ,,
في الأيام الأخيرة وضعت درسين ,, ولكن لا يوجد أحد !!
وأرجو أن تعذروني في الغياب ..
سبق أن قلت لكم أني
مسافر (ورجعت) + مشغول + المنتدى يتعطل ,, ويرجع خمس دقايق ,, ويرجع يتعطل !!
بعض الأحيان أعمل الدرس ,, لما أضغط على اعتمد يتعطل المنتدى ((طار الدرس :er: ))
شكرا لك ,,
بإنتظار تطبيقك على Function :mad:
 
بعد ما نسينا كل شئ بترجعنا تانى
ع العموم بارك الله فيك
الدرس شوى مبهم
اتمنى تضع لنا امثله اكثر تبين اهمية المشروح فى الدرس
PHP:
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.0.0
 Author:         myName

 Script Function:
	Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

m("يارب ")
m("الشيخ يحــن")
m("علينا بدروس وشروحات")
m("ويسهل علينا الدوال")

Func m($text,$Title="ادعو معى")
	MsgBox(16,$Title,$Text)
EndFunc
 
توقيع : فدى الرسول
عودة
أعلى