Sign in to follow this  
Followers 0
Funk

My first script

5 posts in this topic

This is my first attempt at a short and sloppy script. It doesn't really have a purpose outside of learning. It's the roughest of a rough draft just so I can get an idea of how it should run. There's probably errors all over the place. I mostly got all this from looking at examples so thanks. :D Fell free to point out a BIG error just don't correct them all...gotta learn some how. I can't get it to start in windowed mode so it hasn't been tested in windowed mode yet.

;Start the game, still working on starting it in windowed mode, if windowed mode
;then no need to click battle.net button, all coords are windowed mode coords
Run($D2Path & $D2Exe)

;Time delay
Sleep(10000)

;Click the battle.net button to connect
MouseClick("Left", 518, 417)

;Time delay
Sleep(5000)

;Double click the account box (if the account name is different this will allow
;the typing in of a different account)
MouseClick("Left", 538, 402, 2, 250)

;Will read the account info from a config file
$Password = IniRead("Config.ini", "Settings", "Password", "NotFound")
send("" & $Account)

;Time delay
Sleep(2000)

;Tab to password box
Send("{TAB}")

;Time Delay
Sleep(2000)

;Will read the password from a config file
$Password = IniRead("Config.ini", "Settings", "Password", "NotFound")

;Time delay
Sleep(2000)

;Enter the password
Send("" & $Password)

;Time delay
Sleep(2000)

;Press enter
Send("{ENTER}")

;Time delay
Sleep(5000)

;Here is where I want to read from my config file to select a char
;Char screen is in a 2x4 grid(2 horizontal 4 vertical)
;Based on what char you specify in the config, it will click on the xy coords
;of that char box(coords of char boxes are in config for now)
;I'm not real familiar with loops but this would seem to be some type of 
;IfthenElse or whatever loop that continues until a char is chosen (yay pseudocode)

;See which char spot is chosen from config, then click on that chars coords
;Looked in the posted source code to confirm what I already had down, this is pretty
;much what is done

If Char = Char1
     then MouseClick("Left", 299, 215, 2, 250)
elseif Char = Char2
     then MouseClick("Left", 588, 222, 2, 250)
endif
endif

;And so on all the way through char 8
    
;time delay
Sleep(5000)

;We should now be in chat, lets create a game

;Time delay before making game
Sleep(10000)

;Click the "Create" button
MouseClick("Left", 723, 548)

;Game name box is already selected for us

;Time delay
Sleep(2000)

;Here is where we would insert our game name
x

;Time delay
Sleep(2000)

;Click in the password box to select it
MouseClick("Left", 633, 296)

;time delay
Sleep(2000)

;Here is where we would insert our password
x

;Time delay
sleep(2000)

;Press enter to create the game
Send("{ENTER}")

;Some in-game movements I tried, movements are mouseclicks

Movement 1 = 520, 368
Movement 2 = 340, 512
Movement 3 = 403, 486
Movement 4 = 459, 495
Movement 5 = 326, 265

Send("w")
Delay
Send("F5")
Delay
Send("F6")
Delay
Send("w")
Delay
Send("F4")

Movement 6 = 465, 126
Movement 7 = 517, 376

Send("F3")
MouseClick("Right", 514, 271, clicks, speed)

Send("F2")
MouseClick("Right", 560, 265, clicks, speed)

;Pixel Colors of x
Decimal = 5789784
Hex = 585858



;Some notes
;Big thanks to rogue5099 for posting Kuk's source code for creating games(I don't
;know who Kuk is ;/). After seeing a 2x4 char layout I realized that it is necessary
;to be able to choose from one of the eight chars. I looked in that source code and 
;its all right there. I also don't know which would be better/easier/more efficient,
;to make games with a generated random name including numbers and letters or to use
;a count increment. Need to look deeper into how those are done.

Share this post


Link to post
Share on other sites



We usually don't support bots for games in this forum (It seems you're doing something for Diablo II) so unless a mod or someone says it's okay, I can't help with that. But I do see what may be wrong.


For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Share this post


Link to post
Share on other sites

I tried to be careful about this sort of thing in my previous post, I know some forums have rules about this stuff. I looked for posting rules but I might have missed them. If you got a link to them please post, I don't want to get banned.

Share this post


Link to post
Share on other sites

Bots are against Diablo II's TOS. Do not discuss them here.

Share this post


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