Sign in to follow this  
Followers 0
evilelf

Random Pick

13 posts in this topic

I am trying to get my little scrip to run a other AutoIT scrip when it gets to a spot on the game.

I am going to have 3 Scrips it can random pick from.

one will be for it to go left. "Path"

one will be were it will go and die. " Path "

and

one will be going to the right. / " Path "

------

I Thought some one had this posted but cant find this.

I thought maybe u all can give me a little hand.

How would i get my AutoIt to play a new Scrip but pick one out of 3 random.

$random = FileOpen( "C:\Documents and Settings\******_Owner\Desktop\***** B*t", 0 )

Thats all i know but it will not open more then 2 files and this one just will not run.


Share this post


Link to post
Share on other sites



I am trying to get my little scrip to run a other AutoIT scrip when it gets to a spot on the game.

I am going to have 3 Scrips it can random pick from.

one will be for it to go left. "Path"

one will be were it will go and die. " Path "

and one will be going to the right. / " Path "

------

I Thought some one had this posted but cant find this.

I thought maybe u all can give me a little hand.

$random = FileOpen( "C:\Documents and Settings\******_Owner\Desktop\***** B*t", 0 )

Thats all i know but it will not open more then 2 files and this one just will not run.

This is what reading that post made me think of:

You are in a maze of twisty passages, all alike...
>N
You are in a maze of twisty passages, all alike...
>S
You are in a maze of twisty passages, all alike...
>E
You are in a maze of twisty passages, all alike...
>W
You are in a maze of twisty passages, all alike...
>

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

_Random(Random(1, 3, 1))

Func _Random($Number)
     Select
          Case $Number = 1
                  ;Script here
          Case $Number = 2
                  ;Or here
          Case $Number = 3
                  ;Or here
          EndSelect
EndFunc

Edited by AzKay

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

_Random(Random(1, 3, 1))

Func _Random($Number)
     Select
          Case $Number = 1
                  ;Script here
          Case $Number = 2
                  ;Or here
          Case $Number = 3
                  ;Or here
          EndSelect
EndFunc
Thank You AzKay Seeing that U posted Info.

Share this post


Link to post
Share on other sites

Thank You AzKay Seeing that U posted Info.

Anytime.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

This is what i got. But it Just Stops at this spot.

Will not load up my text. note pad.

I am going to Open up other AutoIt random and then close at the end so it look likw this.

_Random(Random(1,3,1))
      
Func _Random($Number)
     Select
          Case $Number = 1
               FileOpen( "C:\Documents and Settings\Compaq_Owner\Desktop\125", 0 )   ;Script here
          Case $Number = 2
                 FileOpen( "C:\Documents and Settings\Compaq_Owner\Desktop\1256", 0 ) ;Or here
          Case $Number = 3
                  ;Or here
      EndSelect
      EndFuncoÝ÷ ئ§Ú¥éî¦az°.-­©Ý¢f§vØ^Éh±æ­¶ÚIÊâ¦Ê"¶Z(ÉbëaÆ®¶­sbb33c¶æFÆRÒfÆT÷Và¢õ&æFöÒ&æFöÒÃ2à ¤gVæ2õ&æFöÒb33c´çVÖ&W" 6VÆV7@¢66Rb33c´çVÖ&W"Ò¢b33c¶æFÆRgV÷C´3¢b3#´Fö7VÖVçG2æB6WGFæw2b3#´6ö×ô÷væW"b3#´FW6·F÷b3#³#RgV÷C²Âµ67&BW&P¢66Rb33c´çVÖ&W"Ò  b33c¶æFÆRgV÷C´3¢b3#´Fö7VÖVçG2æB6WGFæw2b3#´6ö×ô÷væW"b3#´FW6·F÷b3#³#SbgV÷C²Â´÷"W&P¢66Rb33c´çVÖ&W"Ò0¢´÷"W&P  VæE6VÆV7@¢VæDgVæ0¤fÆT6Æ÷6Rb33c¶æFÆR

Share this post


Link to post
Share on other sites

Its not running notepad because your syntax is incorrect.

$handle = FileOpen

I'm guessing $handle is the file you want opened?

FileOpen ( "filename", mode )

FileOpen("notepad.exe", 1)

1 is Write mode, 0 is read mode.


Pink Floyd - The Wall

Share this post


Link to post
Share on other sites

and if you want to have it run scripts from your script use this with the run command:

AutoIt3.exe /AutoIt3ExecuteScript script.au3


[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
Share on other sites

Its not running notepad because your syntax is incorrect.

$handle = FileOpen

I'm guessing $handle is the file you want opened?

FileOpen ( "filename", mode )

FileOpen("notepad.exe", 1)

1 is Write mode, 0 is read mode.

Umm... No. :)

This would be correct:

$filename = "C:\Documents and Settings\Compaq_Owner\Desktop\125"
$handle = FileOpen($filename, 0)oÝ÷ Ù8^~éܶ*')^:§­ën®{©Ýëh¶WèZÙ^²Ú+yاÓ~¡jweyƧmë¬yا²×víçâéÚçè­û­º·«y§h¯
âµè¶¦¡×°jÉ÷öÝ(¥êÚ¶*'°ò¢ë¬{Mú~)^©z÷«Êئ{*.q©e~ÞÅ©©ábå«×w­çâçâì"VÞ¢§yÖ§uÉh±ç^½êò¶)RȧØ^©Ýæ¥,¶W­¢ËZÊ^·­Áç§Â¸­zÉ)ඬr¸©µö¬µêÚÙ^²Çb²Ka­«!xéèµêZuÊ&©Ýʬ0¢é]¢§iø¥yú+¸­x"Ø^rêëz{]·¶òq©eyÙèµêZuì^{az趦^¥§^Åäè®éç¢×©iÖ§v¯z+h¥éÚ~)^jëh×6Run("notepad.exe " & $filename)

You can't use a handle with the notepad.exe command line, so do FileClose($handle) first, then run notepad with $filename.


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

O thnx man I love u all.

Well i am going to show u what i got as right now.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;    Author:Evil_Elf ;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;  Farming BOT     ;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 
;================================================================> Dont Edit this File Less Told to do so.
; %^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%
; %^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%^%
;=================================================> The Start...
#include <GUIConstants.au3>
#include <File.au3>
HotKeySet("{ESC}", "Terminate")

Func Terminate()
Exit 0
EndFunc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MsgBox(4096, "!!UnderStand!!", "First off I like to say Thanks For Downloaden MY Elona Reach Bot. Report all Bugs. Evil_Elf_mike@hotmail.com. Also U Understand u cant Blame Me for the Loss of a account. This will last for 10 secs.", 10)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Account = InputBox("Account", "Type Your Account Name.", "" , "", _
    -1, -1, 0, 0) 
$password = InputBox("PassWord", "Type Your Accounts PassWord.", "" , "", _
    -1, -1, 0, 0)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 Run("D:\Guild Wars\GW.EXE") 
WinWaitActive("Guild Wars")
Sleep(7000)
MouseClick( "left" , 264, 220 , 1 )
Send($Account)
Send("{TAB}")
Send($password)
MouseClick( "left" , 340, 232 , 1 )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  $handle = FileOpen
      _Random(Random(1,3,1))
       
Func _Random($Number)
     Select
          Case $Number = 1
               $handle( "C:\Documents and Settings\Compaq_Owner\Desktop\125", 0 )   ;Script here
          Case $Number = 2
               $handle( "C:\Documents and Settings\Compaq_Owner\Desktop\1256", 0 ) ;Or here
          Case $Number = 3
                  ;Or here
                  
      EndSelect
  EndFunc
FileClose($handle)

BUt the Lower Part would be edit liek u all said.


Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

It sounds like to me you want to "run" the scripts. To do that it would be like:

_Random(Random(1,3,1))
       
Func _Random($Number)
     Select
          Case $Number = 1
             $RUN_PID = Run(@AutoItExe & " /AutoIt3ExecuteScript ""PATH\SCRIPT1.au3""")
          Case $Number = 2
             $RUN_PID =  Run(@AutoItExe & " /AutoIt3ExecuteScript ""PATH\SCRIPT2.au3""")
          Case $Number = 3
             $RUN_PID =  Run(@AutoItExe & " /AutoIt3ExecuteScript ""PATH\SCRIPT3.au3""") 
    EndSelect
EndFunc

Hallman

Edited by Hallman

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

_Random(Random(1,3,1))
       
Func _Random($Number)
     Select
          Case $Number = 1
             $RUN_PID = Run(@AutoItExe & " /AutoIt3ExecuteScript ""PATH\SCRIPT1.au3""")
          Case $Number = 2
             $RUN_PID =  Run(@AutoItExe & " /AutoIt3ExecuteScript ""PATH\SCRIPT2.au3""")
          Case $Number = 3
             $RUN_PID =  Run(@AutoItExe & " /AutoIt3ExecuteScript ""PATH\SCRIPT3.au3""") 
    EndSelect
EndFunc
oÝ÷ Øv¥f§þ«¨µæ®¶­sbb33cµ%TåõBÒ'VâWFôDWRfײb33²ôWFôC4WV7WFU67&BgV÷CµDb3#µ45$Bb33²f×µ&æFöÒÃ2Ãfײb33²æS2gV÷C²b33²
:)
Edited by Manadar

Share this post


Link to post
Share on other sites

$RUN_PID = Run(@AutoItExe & ' /AutoIt3ExecuteScript "PATH\SCRIPT'&Random(1,3,1)&'.au3"')

LOL so this would be the right one then for me to run a random File? Wow i am glad i have u all never would have found out.


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0