News:

So the widespread use of emojis these days kinda makes forum smileys pointless, yeah?

Main Menu

[JS] Clean Slate WebBot

Started by Joe, November 21, 2009, 11:25:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joe

When I was sifting through files on joe.javaop.com, I found a bunch of stuff that might be of some value (nostalgic or otherwise) to someone. I'm going to clean a bunch of it up and post it here, since the BotDev forum is dead.

Of course, this won't work. Not only is CSB incapable of connecting to Battle.net (and has been for years), but I don't remember how I used to construct a CSB in VBScript/JavaScript. But still, I think this is cool.

<!--
  CSB WebBot
  Written by Joe[x86]
-->

<html>
  <head>
    <title>CSB WebBot by Joe[x86]</title>
  </head>
  <body>
    HTML Webbot by Joe[x86] loaded.<br />
    Thanks to Cuphead[vL] and zorm[vL] for writing CSB.<br />
   
    <script Language="javascript">
        // Configure the bot
        CSB.Accept      = 579728
        CSB.Username    = InputBox("Username?")
        CSB.Password    = InputBox("Password?")
        CSB.Product     = InputBox("Product (4-Byte Reversed)?")
        CSB.Server      = InputBox("Server?")
        CSB.CDKey       = InputBox("Key?")
        CSB.HomeChannel = InputBox("Home channel?")
        // Connect the bot
        CSB.Connect
    </script>
  </body>


  <script language="javascript" for="CSB" event="BnetConnected">
    document.write("[BNCS] Connected!<br>\n");
  </script>
       
  <script language="javascript" for="CSB" event="BnetConnecting">
    document.write("[BNCS] Connecting..<br>\n");
  </script>
       
  <script language="javascript" for="CSB" event="BnetDisconnected">
    document.write("[BNCS] Disconnected!<br>\n");
  </script>

  <script language="javascript" for="CSB" event="BnetError">
    document.write("[BNCS] Error " + ErrorNumber + ": " + Description
            + ".<br>\n");
  </script>
       
  <script language="javascript" for="CSB" event="BNLSAuthEvent">
    if (Success) {
      document.write("[BNLS] Authorized!<br>\n");
    } else {
      document.write("[BNLS] Authorization failed!<br>\n");
    }
  </script>
       
  <script language="javascript" for="CSB" event="BNLSConnected">
    document.write("[BNLS] Connected!<br>\n");
  </script>
       
  <script language="javascript" for="CSB" event="BNLSConnecting">
    document.write("[BNLS] Connecting..<br>\n");
  </script>
       
  <script language="javascript" for="CSB" event="BNLSError">
    document.write("[BNLS] Error " + ErrorNumber + ": " + Description
            + ".<br>\n");
  </script>
     
  <script language="javascript" for="CSB" event="JoinedChannel">
    document.write("[BNCS] Joined Channel " + ChanelName + ".<br>\n");
  </script>
     
  <script language="javascript" for="CSB" event="LoggedOnAs">
    document.write("[BNCS] Logged on as " + Username + " using " + Product
            + ".<br>\n");
  </script>

  <script language="javascript" for="CSB" event="LogonEvent">
    switch (Message) {
        default:
            document.write("[BNCS] Logon Event: Unhandled LogonEvent -- "
                    + Message + ".<br>\n");
    }
  </script>
       
  <script language="javascript" for="CSB" event="News">
    document.write("[BNCS] News: " + News + "<br>\n");
  </script>
       
  <script language="javascript" for="CSB" event="ServerError">
    document.write("[BNCS] Error: " + Message + "<br>\n");
  </script>
       
  <script language="javascript" for="CSB" event="ServerInfo">
    document.write("[BNCS] Info: " + Message + "<br>\n");
  </script>
       
  <script language="javascript" for="CSB" event="UserEmote">
    document.write(Username + " (Emote): " + Message + "<br>\n");
  </script>
       
  <script language="javascript" for="CSB" event="UserInChannel">
    document.write(Username + " is in the channel using " + Product
            + " with a ping of " + Ping + ".");
  </script>
       
  <script language="javascript" for="CSB" event="UserJoins">
    document.write(Username + " has joined the channel using " + Product + ".");
  </script>
     
  <script language="javascript" for="CSB" event="UserLeaves">
    document.write(Username + " has left the channel.");
  </script>

  <script language="javascript" for="CSB" event="UserTalk">
    document.write(Username + ": " + Message);
  </script>
     
  <script language="javascript" for="CSB" event="VersionCheck">
    Select Case Message
      Case Else
        document.write("[BNLS] Version Check: Unhandled Byte: " + Message
                + ". ExtraInfo: " + ExtraInfo);
    End Select
  </script>
       
  <script language="javascript" for="CSB" event="WhisperFromUser">
    document.write(Username + " (Whisper): " + Message);
  </script>
       
  <script language="javascript" for="CSB" event="WhisperToUser">
    document.write("You whisper to " + Username + ": " + Message);
  </script>
 
</html>
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


Camel

Document.write() is deprecated these days :)

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!

Joe

Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


Camel

Quote from: Joe on November 23, 2009, 01:15:29 PM
Since when?
Since even IE supports OO JS manipulation of the DOM. Document.write() is slower, because the browser has to bring up the HTML parser, and follow the whole chain as if it were re-rendering the page from scratch.

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!

MyndFyre

Agreed. JinxBot and the web version manipulate the DOM tree with document.createElement() and element.appendChild().
Quote from: Joe on January 23, 2011, 11:47:54 PM
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Quote from: Rule on May 26, 2009, 02:02:12 PMOur species really annoys me.