Jump to content
Sign in to follow this  
anhyeuem

How to write a Script: "Delete a file after exit it"

Recommended Posts

anhyeuem

thank you so much, my teachers.
I am newbie so i want to write a Script:

1. When i finished play videos my Script will delete that videos. Because when we playing videos, our script can not delete them.

2. my videos has Patch: C:WindowsDirtest*.avi ~ @WindowsDir & "test*.avi

Therefore, my script is impossible:
If FileExists(@WindowsDir & "test*.avi") Then FileDelete(@WindowsDir & "test*.avi")

Can you help me, please.
thanks

Share this post


Link to post
Share on other sites
czardas

Hi KstGamesandsoftwares. I think you are from Vietnam. What video software are you using to watch the videos? Why are the videos in the Windows directory? I don't understand this.

Share this post


Link to post
Share on other sites
Starstar

okay nếu như trên đây gõ tiếng việt mà ko bị del thì mong cao thủ giúp như sau:

Có một số game như sau ạ:

1. Mỗi lần chạy sẽ có hộp thoại bắt nhập pass có title: "Enter password"

2. Nhập xong pass là: 123456 thì sẽ vào game có title là: "Game"

3. Tuy nhiên một số game thì ko cần 1 và 2 mà vào luôn game có title là :"Game". Tức là ko có pass.

Vậy có cách nào viết script autoit chọn đường dẫn game, rồi khi chọn xong sẽ vào game, nếu 1 xuất hiện thì tự gõ pass rồi vào game, nếu vào luôn game mà ko có pass thì thoát game. Trước khi chạy game thì kiểm tra xem có hộp "Enter password" hay hộp "Game" không, nếu có thì thoát.

Em viết như sau:

if WinExists("Enter password") Then

WinClose("Enter password")

EndIf

if WinExists("Game") Then

WinClose("Game")

EndIf

$a = FileOpenDialog("game", "", "All (*.*)")

Run($a)

While 1

if WinExists("Enter password") Then

WinSetState ( "Enter password", "", @SW_HIDE )

Controlsettext("Enter password","","Edit1","123456")

Controlsend("Enter password","","","{enter}")

ExitLoop

Else

EndIf

WEnd

.... Tuy nhiên khi mà game nào ko có pass vào luôn thì nó ko exit game đó ạ. Vậy phải thêm dòng nào  anh?

i think you are looking a script for games purpose..........with the help of google translator i can also understand vietnamese...............do not being a clever......

Edited by Starstar

Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once."

Share this post


Link to post
Share on other sites
Melba23

KstGamesandsoftwares,

Starstar is quite right - please read the Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing game automation - before you post again. Thread locked. :naughty:

But welcome to the AutoIt forum - and see you soon with a legitimate question I hope. :)

M23

  • Like 1

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.