Cheating Network
 
 

Go Back   Cheating Network > Programming > Bot Makers
Reload this Page Need help making CL bot



Bot Makers

This is a discussion about Need help making CL bot within the Bot Makers section, where you will These are the public forums for bot makers to interact with others! Got an idea for a bot and don't know how to make it into code? Post it here!



Reply
 
LinkBack Thread Tools Display Modes
Old 02-07-2009, 06:23 PM   #1 (permalink)
Senior Member
 
firefreek's Avatar
 
Join Date: Dec 2008
Posts: 357
Reputation: 23
firefreek is on a distinguished road

cBay Rating:
Send a message via AIM to firefreek
Default Need help making CL bot

(Edited post to fit new situation

So I've gotten pretty far for a newb at AHK. I've been making a bot for CL that is identical to Revolver .357. I can see how it's creator might have struggled in it's creation. So far I've resorted to not make it silent, since, I have no idea how to do that with Controlclick. It's cause it uses the browser control in it's own GUI. And as to doing all three games at the same time, I can't figure out how to arrange the loops so they answer in rapid succession.

So I'm requesting some help here, and i'll post my source. I'm not planning on releasing it since there are probably better tools out there. That, and I used the code from DBN and an example I found.

So here's the source:
Code:
OnExit, WebTerminate
SetTitleMatchMode, 2
SetControlDelay -1
W := A_ScreenWidth-100
H := A_ScreenHeight-100
WinTitle = Be A Man v1.0
ChickMouseX := 317
ChickMouseY := 381
SpellMouseX := 320
SpellMouseY := 335
WordMouseX := 320
WordMouseY := 394
WinGet, WinID, ID, Be A Man v1.0
Delay := 1000


GUI:
Gui +LastFound
   Gui Margin, 0, 0
   Gui, Add, Tab2, h50 w%W% gMyTab vSelTab, Chicktionary|SpellingBee|WordSlugger
   Gui, Tab, 1
   Gui, Add, Button, x0 y25 w100 h20 gLoadGames, Load Games
   Gui, Add, Edit, x100 y25 w380 h20 vletters1,
   Gui, Add, Button, x480 y25 w100 h20 gGo1, Go!
   Gui, Tab, 2
   Gui, Add, Button, x0 y25 w100 h20 gLoadGames, Load Games
   Gui, Add, Edit, x100 y25 w380 h20 vletters2,
   Gui, Add, Button, x480 y25 w100 h20 gGo2, Go!
   Gui, Tab, 3
   Gui, Add, Button, x0 y25 w100 h20 gLoadGames, Load Games
   Gui, Add, Edit, x100 y25 w380 h20 vletters3,
   Gui, Add, Button, x480 y25 w100 h20 gGo3, Go!
   GoSub, WebInit
   Gui, Show, h420 w650, %WinTitle%
   WinGet, WinID, ID, Be A Man v1.0
   Return

WebInit:
   GoSub, GuiStart
   hGui := WinExist()
   pwb1 := COM_AtlAxGetControl(COM_AtlAxCreateContainer(hGui,  0, 50, 650, 350, "Shell.Explorer"))
   pwb2 := COM_AtlAxGetControl(COM_AtlAxCreateContainer(hGui, 0, 50, 650, 350, "Shell.Explorer"))
   pwb3 := COM_AtlAxGetControl(COM_AtlAxCreateContainer(hGui, 0, 50, 650, 350, "Shell.Explorer"))
    psink1 := COM_ConnectObject(pwb1, "Web1_")
    psink2 := COM_ConnectObject(pwb2, "Web2_")
    psink3 := COM_ConnectObject(pwb3, "Web3_")
   OldhWnd := Chicktionary := GetHostWindow(pwb1)
   SpellingBee := GetHostWindow(pwb2)
   WordSlugger := GetHostWindow(pwb3)
   WinHide, ahk_id %IE3%
   COM_Invoke(pwb1, "Navigate", "http://login.live.com/login.srf?wa=wsignin1.0&rpsnv=10&ct=1234036872&rver=5.5.4177.0&wp=MBI&wreply=http:%2F%2Fclub.live.com%2FPages%2FHome%2FHomePage.aspx%3Flc%3D1033&lc=1033&id=251128")
loop
      If (rdy:=COM_Invoke(pwb1,"readyState") = 4)
         break
Return

GuiStart:
COM_AtlAxWinInit()
Return
MyTab:
Gui, Submit, NoHide
WinHide, % "ahk_id " .  OldhWnd
WinShow, % "ahk_id " .  %SelTab%
OldhWnd := %SelTab%
Gui, Show
   return

LoadGames:
COM_Invoke(pwb1, "Navigate", "http://club.live.com/Pages/Games/GamePlay.aspx?game=Chicktionary&mode=play")
;COM_Invoke(pwb2, "Navigate", "http://club.live.com/Pages/Games/GamePlay.aspx?game=Spelling_Bee&mode=play")
;COM_Invoke(pwb3, "Navigate", "http://club.live.com/Pages/Games/GamePlay.aspx?game=Word_Slugger&mode=play")
loop
      If (rdy:=COM_Invoke(pwb1,"readyState") = 4)
         break
Return

Go1:
Gui, Submit, NoHide
if ( StrLen( letters1 ) != 7 )
{
    Msgbox, 16, Be A Man v.10, You must enter 7 letters.
    return
}
File = %A_Temp%\CBot_tmp.htm
RunWait, curl.exe --output "%File%" --form-string "letters=%letters1%" -F "request=form" -F "sort=length" "http://www.anagrammer.com/",, UseErrorLevel Hide
CurlError := ErrorLevel

IfNotExist, %File%
{
    Msgbox, 16, Be A Man v1.0, Failed to download word list. Error code: %CurlError%`nSee this page to get the code definition: http://curl.haxx.se/docs/manpage.html#EXIT
    Gui, Show
    return
}

FileRead, WordPage, %File%
FileDelete, %File%

StringGetPos, Position, WordPage, <p style='font-family:Verdana;'>
If ErrorLevel
{
    Msgbox, 16, Be A Man v1.0, Anagrammer.com did not send a word list! The HTML it sent has been saved to the clipboard.
    Clipboard := WordPage
    return
}
StringTrimLeft, WordPage, WordPage, %Position%
StringLeft, WordPage, WordPage, % InStr( WordPage, "`n" ) ;%

; Interpret HTML
StringReplace, WordPage, WordPage, <br>, `n, All
StringReplace, WordPage, WordPage, &nbsp;, %A_Space%, All

WordList := ""

IsInTag := false
Loop, % StrLen( WordPage ) ;%
{
    if IsInTag
    {
        if ( SubStr( WordPage, A_Index, 1 ) = ">" )
            IsInTag := false
        
        continue
    }
    if ( SubStr( WordPage, A_Index, 1 ) = "<" )
    {
        IsInTag := true
        continue
    }
    
    WordList .= SubStr( WordPage, A_Index, 1 )
}
WordPage := ""

StringReplace, WordList, WordList, %A_Space%- bingo,, All

StringTrimRight, WordList, WordList, CPosition

StringReplace, Clipboard, WordList, `n, `r`n, All ; Save to the clipboard with the correct newline format for notepad.

if ( GetKeyState( "ScrollLock", "T" ) )
    SetScrollLockState, Off


Aborted := false
Loop, Parse, WordList, `n, %A_Space%%A_Tab%1234567890
{
        Sleep, %Delay%
if ( A_LoopField == "Chars" || A_LoopField = "" )
        continue
    
    if ( GetKeyState( "ScrollLock", "T" ) )
    {
        Aborted := true
        break
    }

    WordLength := StrLen( A_LoopField )
    if ( WordLength < 3 )
        break

    if ( WordLength > 7 )
    {
        Msgbox, 16, Chiktionary Bot, A word was recieved that is longer than 7 letters. Anagrammer.com probably didn't send a proper word list.
        Clipboard := WordPage
        Gui, Show
        break
    }
    
    

    WinActivate, ahk_id %WinID%
    Click, %ChickMouseX%, %ChickMouseY% ; Make sure the flash input is active.
    SendRaw, %A_LoopField%
    Send, {Click 493 381}{BS}{BS}{BS}{BS}{BS}{BS}{BS} ; 
}
Aborted := false
;
;
;
;
;    ;
;
;
;
Return
Go2:
Gui, Submit, NoHide
COM_Invoke(pwb2, "Navigate", Go1)
loop
      If (rdy:=COM_Invoke(pwb2,"readyState") = 4)
         break
Return
Go3:
Gui, Submit, NoHide
COM_Invoke(pwb3, "Navigate", Go1)
loop
      If (rdy:=COM_Invoke(pwb3,"readyState") = 4)
         break
Return
   
GuiClose:
WebTerminate:
Gui, Destroy
      COM_Release(pwb1)
      COM_Release(pwb2)
      COM_Release(pwb3)
      COM_AtlAxWinTerm()
      ExitApp

Web1_NavigateComplete2(prms, this)
{
   Global
      GuiControl,text,page1,% COM_Invoke(pwb1, "LocationUrl")
}
Web2_NavigateComplete2(prms, this)
{
   Global
      GuiControl,text,page2,% COM_Invoke(pwb2, "LocationUrl")
}
Web3_NavigateComplete2(prms, this)
{
   Global
      GuiControl,text,page3,% COM_Invoke(pwb3, "LocationUrl")
}
GetHostWindow(pwb)
{
   COM_GUID4String(IID_IOleWindow, "{00000114-0000-0000-C000-000000000046}")
   DllCall(COM_VTable(pwb, 0), "Uint", pwb, "str", IID_IOleWindow, "UintP", pow)
   DllCall(COM_VTable(pow, 3), "Uint", pow, "UintP", hWnd)
   DllCall(COM_VTable(pow, 2), "Uint", pow)
   Return DllCall("GetParent", "Uint", hWnd)
}
Yeah, half of it is copy paste of DBN source, the other half an example of IE controls. The problems I need solved are:

1. How can I make the bot silent, and still functional?
2. How can I run all the games at the same time, answering one after the other?

EDIT: Here's the compiled version of this source:http://rapidshare.com/files/195318632/BeAMan.exe
firefreek is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 10-19-2009, 11:37 PM   #2 (permalink)
Junior Member
 
Join Date: May 2009
Posts: 6
Reputation: -1
xdewreckx has a little shameless behaviour in the past

cBay Rating:
Default

i dont know but i hope you figure it out
xdewreckx is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
bot, cl, making


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
(AHK) Need help making a bot jromper2000 General 5 12-18-2008 11:28 PM
a CL account making bot fruity_looper Bot Makers 8 11-14-2008 12:30 AM
Making A Bot... SKy Scripter General 4 06-18-2008 12:05 AM
Sig Making Justin555 Chit Chat 11 04-17-2008 07:46 PM
Sig Making Nadroj Graphics Section 46 02-26-2008 03:00 PM




Powered by vBulletin
Copyright © 2000-2008 Jelsoft Enterprises Limited.
Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.