Sign in to follow this  
Followers 0
D3monik

Looking for simple D2 Chat Script

19 posts in this topic

Hi, new here, been searching for hours around the net so I finally joined up and asking my question! I basically want to create a autoit script that will use a few hot keys to send certain messages while in a game. Like set the "home" key to activate a certain message or if i press it two times it will send the 2nd message.

I would also like to know how to make it so i can press a hotkey in chat screen and have it say "Example-1 will begin shortly" and have it count up each time for the game numbers.

Im assuming from what i know about autoit that this should not be too complicating and I should be able to easily do it on my own. I just have no clue where to start!

Any help is greatly appreciated.

--Nate

Share this post


Link to post
Share on other sites



Ok, Im assuming that would be for the chat channel messages in which i leave a game, hit the hotkey and it will count up in increments of one each time i press that hotkey?

What about for the messages each time a press a certain hotkey?

BTW, thank you for the reply, didnt think i would get one!

--Nate

Share this post


Link to post
Share on other sites

Still searching for an answer to my first question, alot of thanx goes to the crazestar for helping me with the second part. :)

--Nate

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Ok, now Im confused. ;)

I just need a simple code where i set a hotkey and when i press that hotkey it will display a message.

Imma test which one of the above codes does what i want it to for the counting up for each game run though.

Thanks to everyone for all the help :)

--Nate

EDIT: Ok, I just tried the above codes and i get an error on both calling for an unknown function.

Edited by D3monik

Share this post


Link to post
Share on other sites

yeah still not working, I dont really NEED that part but would actually be more interested in the messages thing using one hotkey per messags. I only need maybe 3 messages which would use 3 different hotkeys. ill give an example:

If you press "HOME" it would spam this message "Welcome to my run! Drops are mine, Enjoy!"

If you press "INSERT" it would spam this message "To follow my runs, join channel Op Clan-PoS"

Maybe if I could get it to work add in a hotkey for this "Game-1 will start shortly" using hotkey "END" and then have it so everytime i press "END" it counts up the run number.

I dont know if i was real clear on what I was trying to do in my first post so maybe this will help out.

--Nate

Share this post


Link to post
Share on other sites

Yeah, I dont know whats up but I keep getting errors and monkey with the line that errors and I cant seem to find what the deal is. I guess Ill just float a buddy of mine some cash to see if he can get what I want.

Thanx guys.

--nate

Share this post


Link to post
Share on other sites

Yeah, I dont know whats up but I keep getting errors and monkey with the line that errors and I cant seem to find what the deal is. I guess Ill just float a buddy of mine some cash to see if he can get what I want.

Thanx guys.

--nate

Here, its the same code, but instead of the $ that errors it has &. I am sure it was a typo, but this one works.

now, you can change it since this just sends the text, ie if you have to hit certain keys to be able to send text in the game.

CODE
HotkeySet("{F9}", "StateNG")

$Game = 1

While 1

Sleep(30000)

WEnd

Func StateNG()

Send("Game " & $Game & " will start soon" & @CRLF,1)

$Game = $Game + 1

EndFunc


func get_quote()
   local $quote 
   switch random(1, 3, 1)
    case 1
     $quote = '"' & "A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, " & _
       "design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give " & _
       "orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, " & _
       "fight efficiently, die gallantly. Specialization is for insects." & '"' & " Robert A. Heinlein"
    case 2
     $quote =  '"' & "Within each of us lies the power of our consent to health and sickness, to riches and poverty, to freedom " & _
       "and to slavery. It is we who control these, and not another." & '"' & " Richard Bach (Illusions)"
    case 3
     $quote ='"' & "Don't handicap your children by making their lives easy." & '"' & " Robert A. Heinlein"
   EndSwitch
   MsgBox(0, "Quote for the moment", $quote & @CRLF)
EndFunc

get_quote()

Share this post


Link to post
Share on other sites

Cool man thanx alot that is exactly what i wanted. Now if I can just get the simple messages to work the same way and have it all run from one script. Kudos bud.

--nate

Share this post


Link to post
Share on other sites

Cool man thanx alot that is exactly what i wanted. Now if I can just get the simple messages to work the same way and have it all run from one script. Kudos bud.

--nate

Here is a bigger example, It shouldn't be too hard to figure out from here, just add things/keys as needed. i added in there, just as a good idea in general, the number pad - key, if you press it twice, then it will exit, but pressing any other key, or waiting for 30 seconds will cancel out the first press you did.

HotkeySet("{F9}", "StateNG")
HotkeySet("{HOME}", "StateRUNS")
HotkeySet("{NUMPADSUB}", "_quit")
$Game = 1
$quit = 0
While 1
 if $quit then $quit = 0
Sleep(30000)
WEnd

func stateRUNS()
Send("Welcome to my run! Drops are mine, Enjoy!" & @CRLF, 1)
 if $quit then $quit = 0
Endfunc

Func StateNG()
Send("Game " & $Game & " will start soon" & @CRLF,1)
$Game = $Game + 1
 if $quit then $quit = 0
EndFunc

Func _quit()
If $quit >= 1 then exit
$quit = $quit + 1
endfunc

func get_quote()
   local $quote 
   switch random(1, 3, 1)
    case 1
     $quote = '"' & "A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, " & _
       "design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give " & _
       "orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, " & _
       "fight efficiently, die gallantly. Specialization is for insects." & '"' & " Robert A. Heinlein"
    case 2
     $quote =  '"' & "Within each of us lies the power of our consent to health and sickness, to riches and poverty, to freedom " & _
       "and to slavery. It is we who control these, and not another." & '"' & " Richard Bach (Illusions)"
    case 3
     $quote ='"' & "Don't handicap your children by making their lives easy." & '"' & " Robert A. Heinlein"
   EndSwitch
   MsgBox(0, "Quote for the moment", $quote & @CRLF)
EndFunc

get_quote()

Share this post


Link to post
Share on other sites

I really appreciate your help, I will check this last one out more tomorrow, Im getting ready to head to bed atm. Im sure I can add in other hotkeys pretty easy since you made it all one script for me. I will let u know what i come up with sometime tomorrow afternoon. :);):D

--Nate

Share this post


Link to post
Share on other sites

Yeik, worked excellent man. I also added in a few more messages and hotkeys and its working just like i wanted! :)

--Nate

Share this post


Link to post
Share on other sites

One more question, is there a way to make these messages spam on their own every so many of seconds? So If I wanted to advertise a clan or something in a chat channel overnight, the messages could auto spam themselves every like 1 minute or so?

--Nate

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

One more question, is there a way to make these messages spam on their own every so many of seconds? So If I wanted to advertise a clan or something in a chat channel overnight, the messages could auto spam themselves every like 1 minute or so?

--Nate

There are certain words that when used on the AutoIt forums have the potentioal of getting a thread locked and possibly even get the user banned.

Among those words you will find

Hack

Spam

Decompile

and numerous others.

Something else that has the potential to get a person banned is providing code which can be considered malicious in nature. I suspect that the answer to your question could fall into this category.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Yeik, worked excellent man. I also added in a few more messages and hotkeys and its working just like i wanted! :)

--Nate

Glad its working out for you and you have learned how to add more.


func get_quote()
   local $quote 
   switch random(1, 3, 1)
    case 1
     $quote = '"' & "A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, " & _
       "design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give " & _
       "orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, " & _
       "fight efficiently, die gallantly. Specialization is for insects." & '"' & " Robert A. Heinlein"
    case 2
     $quote =  '"' & "Within each of us lies the power of our consent to health and sickness, to riches and poverty, to freedom " & _
       "and to slavery. It is we who control these, and not another." & '"' & " Richard Bach (Illusions)"
    case 3
     $quote ='"' & "Don't handicap your children by making their lives easy." & '"' & " Robert A. Heinlein"
   EndSwitch
   MsgBox(0, "Quote for the moment", $quote & @CRLF)
EndFunc

get_quote()

Share this post


Link to post
Share on other sites

There are certain words that when used on the AutoIt forums have the potentioal of getting a thread locked and possibly even get the user banned.

Among those words you will find

Hack

Spam

Decompile

and numerous others.

Something else that has the potential to get a person banned is providing code which can be considered malicious in nature. I suspect that the answer to your question could fall into this category.

I am not asking for a in game spammer to spam stupid messages, Im simply asking for something that will be used in advertising my sites I have setup for the game.

How would the previous codes that i asked for in spamming messages with a hotkey be any different than it doing it on its own at a timed interval?

--Nate

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