Jump to content

huh? what's wrong here?


Recommended Posts

what is wrong with $friendslist?? this should be working or am I being stupid again?

Global $friendslist = "http://www.facebook.com/friends/?ref=tn#/friends/?id=" & GUICtrlRead($ID) & "&" & GUICtrlRead($FLID) & "=0&view=search&q=" & $name & "&nt=0&nk=0&s=0&st=0"
ConsoleWrite(GUICtrlRead($ID))
ConsoleWrite(GUICtrlRead($FLID))
ConsoleWrite("http://www.facebook.com/friends/?ref=tn#/friends/?id=" & GUICtrlRead($ID) & "&" & GUICtrlRead($FLID) & "=0&view=search&q=" & $name & "&nt=0&nk=0&s=0&st=0")
ConsoleWrite($friendslist)

and here's the output...

55

66

http://www.facebook.com/friends/?ref=tn#/f...mp;s=0&st=0

http://www.facebook.com/friends/?ref=tn#/f...mp;s=0&st=0

why is ConsoleWrite($friendslist) not working?

Link to comment
Share on other sites

what is wrong with $friendslist?? this should be working or am I being stupid again?

Global $friendslist = "http://www.facebook.com/friends/?ref=tn#/friends/?id=" & GUICtrlRead($ID) & "&" & GUICtrlRead($FLID) & "=0&view=search&q=" & $name & "&nt=0&nk=0&s=0&st=0"
 ConsoleWrite(GUICtrlRead($ID))
 ConsoleWrite(GUICtrlRead($FLID))
 ConsoleWrite("http://www.facebook.com/friends/?ref=tn#/friends/?id=" & GUICtrlRead($ID) & "&" & GUICtrlRead($FLID) & "=0&view=search&q=" & $name & "&nt=0&nk=0&s=0&st=0")
 ConsoleWrite($friendslist)

and here's the output...

55

66

http://www.facebook.com/friends/?ref=tn#/f...mp;s=0&st=0

http://www.facebook.com/friends/?ref=tn#/f...mp;s=0&st=0

why is ConsoleWrite($friendslist) not working?

Looks like it is to me. Are you holding something back from us?
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

what you mean holding back?

here's the complete script.

#cs ----------------------------------------------------------------------------
    
    AutoIt Version: 3.3.0.0
    Author:      myName
    
    Script Function:
    Template AutoIt script.
    
#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <String.au3>
#include <Array.au3>


Dim Const $navOpenInNewTab = 0x0800
Global $oIE, $oLinks, $new_link, $FLID_input, $ID, $FLID, $name

Global $sURL1 = "http://apps.facebook.com/inthemafia/remote/html_server.php?xw_time=1237431239&xw_exp_sig=c6797f3043ff094e132d44986eb9d1b4&xw_controller=recruit&xw_action=view"
Global $sSearch = "http://www.facebook.com/profile.php?id="
Global $sReplace = "http://apps.facebook.com/inthemafia/status_invite.php?from="
Global $friendslist = "http://www.facebook.com/friends/?ref=tn#/friends/?id=" & GUICtrlRead($ID) & "&" & GUICtrlRead($FLID) & "=0&view=search&q=" & $name & "&nt=0&nk=0&s=0&st=0"



#Region ### START Koda GUI section ### Form=d:\documents and settings\evil_elf\my documents\form1_1.kxf
$Form1_1 = GUICreate("Mafia Wars friendslist inviter", 338, 340, 334, 158)
GUISetBkColor(0xC0C0C0)
$txt1 = GUICtrlCreateLabel("This application will automatically add", 28, 16, 289, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
GUICtrlSetColor(-1, 0x800000)
$txt2 = GUICtrlCreateLabel("your uninvited friends to mafia wars.", 37, 48, 271, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
GUICtrlSetColor(-1, 0x800000)
$Button1 = GUICtrlCreateButton("THANK YOU!!!", 99, 288, 147, 41, 0)
GUICtrlSetFont(-1, 12, 800, 2, "Georgia")
GUICtrlSetColor(-1, 0xFF0000)
$txt5 = GUICtrlCreateLabel("How many seconds sleep between adding", 23, 80, 299, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
GUICtrlSetColor(-1, 0x800000)
$txt6 = GUICtrlCreateLabel("every person?", 23, 112, 105, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
GUICtrlSetColor(-1, 0x800000)
$sleep = GUICtrlCreateInput("", 135, 104, 57, 24, BitOR($ES_AUTOHSCROLL, $ES_NUMBER))
GUICtrlSetLimit(-1, 4)
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
$txt3 = GUICtrlCreateLabel("Your ID?", 24, 144, 69, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
GUICtrlSetColor(-1, 0x800000)
$ID = GUICtrlCreateInput("", 160, 144, 145, 24, BitOR($ES_AUTOHSCROLL, $ES_NUMBER))
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
$txt4 = GUICtrlCreateLabel("Friendslist ID?", 24, 176, 110, 20)
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
GUICtrlSetColor(-1, 0x800000)
$FLID = GUICtrlCreateInput("", 160, 176, 145, 24, BitOR($ES_AUTOHSCROLL, $ES_NUMBER))
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
$INCLUDE = GUICtrlCreateRadio("INCLUDE only this friendlist", 24, 216, 233, 17)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
GUICtrlSetColor(-1, 0x800000)
$EXCLUDE = GUICtrlCreateRadio("EXCLUDE this friendlist", 24, 240, 201, 17)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
GUICtrlSetColor(-1, 0x800000)
$remove = GUICtrlCreateCheckbox("Remove them after processing?", 24, 264, 249, 17)
GUICtrlSetFont(-1, 10, 800, 0, "Georgia")
GUICtrlSetColor(-1, 0x800000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $Button1
            START()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
    If GUICtrlRead($FLID) <> $FLID_input Then
        GUICtrlSetState($INCLUDE, $GUI_SHOW)
        GUICtrlSetState($EXCLUDE, $GUI_SHOW)
    Else
        GUICtrlSetState($INCLUDE, $GUI_HIDE)
        GUICtrlSetState($EXCLUDE, $GUI_HIDE)
    EndIf
WEnd

Func START()
    ConsoleWrite(GUICtrlRead($ID))
    ConsoleWrite(GUICtrlRead($FLID))
    ConsoleWrite("http://www.facebook.com/friends/?ref=tn#/friends/?id=" & GUICtrlRead($ID) & "&" & GUICtrlRead($FLID) & "=0&view=search&q=" & $name & "&nt=0&nk=0&s=0&st=0")
    ConsoleWrite($friendslist)






;   $oIE = _IECreate($sURL1)
;   $sHTML = _IEBodyReadText($oIE)
;   $output = StringSplit($sHTML, "join. ", 1)
;   $uninvitedlist = StringLeft($output[2], StringInStr($output[2], "You haven't selected") - 1)
;   $arrayOfNames = StringRegExp($uninvitedlist, "([A-Z][a-z]+ [A-Z][a-z]+(?: [A-Z][a-z]+)?(?: [A-Z][a-z]+)?)", 3)
;   For $name In $arrayOfNames
;       MsgBox(0, "", $name)
;       $oIE.Navigate2($friendslist, $navOpenInNewTab)
;       ConsoleWrite($friendslist)



;       $oLinks = _IELinkGetCollection($oIE)
;       For $oLink In $oLinks
;           If StringInStr($oLink.href, $sSearch) Then
;               $new_link = StringReplace($oLink.href, $sSearch, $sReplace)
;               ConsoleWrite("$new_link = " & $new_link & @LF)
;               Sleep(10000)
;               $oIE.Navigate2($new_link, $navOpenInNewTab)
;           EndIf
;       Next
;   Next

EndFunc ;==>START

my problem is that I need the linkgetcollection from $friendslist, not from teh original created url cause that will give me false data....

Edited by Overlord
Link to comment
Share on other sites

what you mean holding back?

It wasn't a serious comment, but you said that

ConsoleWrite($friendslist)

wasn't working, but there it was in your post as far as I could see.

You said the output was

55
66
[url="http://www.facebook.com/friends/?ref=tn#/friends/?id=55&66=0&view=search&q=&nt=0&nk=0&s=0&st=0"]http://www.facebook.com/friends/?ref=tn#/f...mp;s=0&st=0[/url]
[url="http://www.facebook.com/friends/?ref=tn#/friends/?id=0&0=0&view=search&q=&nt=0&nk=0&s=0&st=0"]http://www.facebook.com/friends/?ref=tn#/f...mp;s=0&st=0[/url]

and those 4 lines were produced from these 4 consolewrite lines

ConsoleWrite(GUICtrlRead($ID))
ConsoleWrite(GUICtrlRead($FLID))
ConsoleWrite("http://www.facebook.com/friends/?ref=tn#/friends/?id=" & GUICtrlRead($ID) & "&" & GUICtrlRead($FLID) & "=0&view=search&q=" & $name & "&nt=0&nk=0&s=0&st=0")
ConsoleWrite($friendslist)

So I don't see what hasn't worked.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

ConsoleWrite($friendslist) should produce

"http://www.facebook.com/friends/?ref=tn#/friends/?id=55&66=0&view=search&q=&nt=0&nk=0&s=0&st=0"]http://www.facebook.com/friends/?ref=tn#/f...mp;s=0&st=0

not

"http://www.facebook.com/friends/?ref=tn#/friends/?id=0&0=0&view=search&q=&nt=0&nk=0&s=0&st=0"]http://www.facebook.com/friends/?ref=tn#/f...mp;s=0&st=0

see the difference?

the only thing different is my way of calling it and I don't know why :-(

ConsoleWrite($friendslist)

should have same result as

ConsoleWrite("http://www.facebook.com/friends/?ref=tn#/friends/?id=" & GUICtrlRead($ID) & "&" & GUICtrlRead($FLID) & "=0&view=search&q=" & $name & "&nt=0&nk=0&s=0&st=0")

because

Global $friendslist = "http://www.facebook.com/friends/?ref=tn#/friends/?id=" & GUICtrlRead($ID) & "&" & GUICtrlRead($FLID) & "=0&view=search&q=" & $name & "&nt=0&nk=0&s=0&st=0"

or am I wrong?

Link to comment
Share on other sites

ConsoleWrite($friendslist) should produce

"http://www.facebook.com/friends/?ref=tn#/friends/?id=55&66=0&view=search&q=&nt=0&nk=0&s=0&st=0"]http://www.facebook.com/friends/?ref=tn#/f...mp;s=0&st=0

not

"http://www.facebook.com/friends/?ref=tn#/friends/?id=0&0=0&view=search&q=&nt=0&nk=0&s=0&st=0"]http://www.facebook.com/friends/?ref=tn#/f...mp;s=0&st=0

see the difference?

the only thing different is my way of calling it and I don't know why :-(

ConsoleWrite($friendslist)

should have same result as

ConsoleWrite("http://www.facebook.com/friends/?ref=tn#/friends/?id=" & GUICtrlRead($ID) & "&" & GUICtrlRead($FLID) & "=0&view=search&q=" & $name & "&nt=0&nk=0&s=0&st=0")

because

Global $friendslist = "http://www.facebook.com/friends/?ref=tn#/friends/?id=" & GUICtrlRead($ID) & "&" & GUICtrlRead($FLID) & "=0&view=search&q=" & $name & "&nt=0&nk=0&s=0&st=0"

or am I wrong?

OK I'll have another look, but note that your first post doesn't show those values so there is no way I could tell what was wrong.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

OK I'll have another look, but note that your first post doesn't show those values so there is no way I could tell what was wrong.

I've had another look.

You set $Friends before you even create the controls so GuiCtrlRead will return 0.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

wiii!! that's 1 problem solved.

now I want to get that page opened in a attached window and get a _IELinkGetCollection done there but this is where I get a new error...

Func START()
    $oIE = _IECreate($sURL1)
    $sHTML = _IEBodyReadText($oIE)
    $output = StringSplit($sHTML, "join. ", 1)
    $uninvitedlist = StringLeft($output[2], StringInStr($output[2], "You haven't selected") - 1)
    $arrayOfNames = StringRegExp($uninvitedlist, "([A-Z][a-z]+ [A-Z][a-z]+(?: [A-Z][a-z]+)?(?: [A-Z][a-z]+)?)", 3)
    For $name In $arrayOfNames
        MsgBox(0, "", $name)
        Global $friendslist = "http://www.facebook.com/friends/?ref=tn#/friends/?id=" & GUICtrlRead($ID) & "&" & GUICtrlRead($FLID) & "=0&view=search&q=" & $name & "&nt=0&nk=0&s=0&st=0"
;           ConsoleWrite($friendslist)
        $oIE.Navigate2($friendslist, $navOpenInNewTab)

        $oLinks = _IELinkGetCollection($friendslist)
        For $oLink In $oLinks
            If StringInStr($oLink.href, $sSearch) Then
                $new_link = StringReplace($oLink.href, $sSearch, $sReplace)
                ConsoleWrite("$new_link = " & $new_link & @LF)
                Sleep(10000)
        ;   $oIE.Navigate2($new_link, $navOpenInNewTab)
            EndIf
        Next
    Next

EndFunc ;==>START

this gives me this error:

--> IE.au3 V2.4-0 Error from function _IELinkGetCollection, $_IEStatus_InvalidDataType

C:\Documents and Settings\Evil_elf\Desktop\auto-inviter II.au3 (111) : ==> Variable must be of type "Object".:

For $oLink In $oLinks

For $oLink In $oLinks^ ERROR

and when I use $oLinks = _IELinkGetCollection($oIE) I get a feeling I'm reading from the original created url and not the last navigated which is $friendslist...??

ideas?

Edited by Overlord
Link to comment
Share on other sites

wiii!! that's 1 problem solved.

now I want to get that page opened in a attached window and get a _IELinkGetCollection done there but this is where I get a new error...

Func START()
     $oIE = _IECreate($sURL1)
     $sHTML = _IEBodyReadText($oIE)
     $output = StringSplit($sHTML, "join. ", 1)
     $uninvitedlist = StringLeft($output[2], StringInStr($output[2], "You haven't selected") - 1)
     $arrayOfNames = StringRegExp($uninvitedlist, "([A-Z][a-z]+ [A-Z][a-z]+(?: [A-Z][a-z]+)?(?: [A-Z][a-z]+)?)", 3)
     For $name In $arrayOfNames
         MsgBox(0, "", $name)
         Global $friendslist = "http://www.facebook.com/friends/?ref=tn#/friends/?id=" & GUICtrlRead($ID) & "&" & GUICtrlRead($FLID) & "=0&view=search&q=" & $name & "&nt=0&nk=0&s=0&st=0"
;           ConsoleWrite($friendslist)
         $oIE.Navigate2($friendslist, $navOpenInNewTab)
 
         $oLinks = _IELinkGetCollection($friendslist)
         For $oLink In $oLinks
             If StringInStr($oLink.href, $sSearch) Then
                 $new_link = StringReplace($oLink.href, $sSearch, $sReplace)
                 ConsoleWrite("$new_link = " & $new_link & @LF)
                 Sleep(10000)
        ;   $oIE.Navigate2($new_link, $navOpenInNewTab)
             EndIf
         Next
     Next
 
 EndFunc;==>START

this gives me this error:

--> IE.au3 V2.4-0 Error from function _IELinkGetCollection, $_IEStatus_InvalidDataType

C:\Documents and Settings\Evil_elf\Desktop\auto-inviter II.au3 (111) : ==> Variable must be of type "Object".:

For $oLink In $oLinks

For $oLink In $oLinks^ ERROR

and when I use $oLinks = _IELinkGetCollection($oIE) I get a feeling I'm reading from the original created url and not the last navigated which is $friendslist...??

ideas?

Look in the help for _IELinkGetCollection becuae it doesn't take a string as a parameter. You could also check @error afterwards to see if the call succeeded.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...