Author Topic: QQ  (Read 1310 times)

Ace

  • Administrators
  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • http://
QQ
« on: October 27, 2008, 06:28:05 PM »
How do you change the value of a variable in a different plugin?  It is public if that helps.
[img]http://zeus.cooltext.com/images/9ff/9fff41541771f1d8f564cabff80fd40cfb587413.jpg\" border=\"0\" class=\"linked-image\" /][img]http://209.85.12.232/13848/49/pip/admin.png\" border=\"0\" class=\"linked-image\" /]

Hero

  • Administrator
  • Hero Member
  • *****
  • Posts: 502
    • View Profile
    • http://rev7.net
QQ
« Reply #1 on: October 27, 2008, 06:33:29 PM »
With what you are trying to do:

 [8:28:19 PM] <Hero.A> 1. If the variables are on different bots it wont work
 [8:28:35 PM] <Hero.A> - If you want to pass variable values use a text file
 [8:28:55 PM] <Hero.A> 2. I would recommend having a text file on the main drive that is called "StealthbotOutput.txt"
 [8:29:59 PM] <Hero.A> - Each bot will have a timer that is staggered (one has 3 second interval, one has a 2 second interval)
 [8:30:22 PM] <Hero.A> - - They will read a line from the text file, then output the line - Removing it from the text file as well
Hero
AKA: HeroAssasin and Mike
- - - - -  - - -
Visit Clan R77
- - - - -  - - -
Please do not PM me with random questions. That is what I made these forums for.

Noob ~Vector

Ace

  • Administrators
  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • http://
QQ
« Reply #2 on: October 28, 2008, 02:44:45 PM »
Ok for like the 2nd way - how would you get the second line in a text file?
[img]http://zeus.cooltext.com/images/9ff/9fff41541771f1d8f564cabff80fd40cfb587413.jpg\" border=\"0\" class=\"linked-image\" /][img]http://209.85.12.232/13848/49/pip/admin.png\" border=\"0\" class=\"linked-image\" /]

Hero

  • Administrator
  • Hero Member
  • *****
  • Posts: 502
    • View Profile
    • http://rev7.net
QQ
« Reply #3 on: October 28, 2008, 03:49:04 PM »
You would want something like this on both bots, in plugin format of course

Code: [Select]
Public Const filePath = "C:\Stealthbot.Linked.Queue.dat"

Sub Timer '// Timer at a five second interval
  SayOutput
End Sub

Sub AddOutput(Text)
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  strFilePath = filePath
 
  '// Create the file if it doesn't exist
  If Not objFSO.FileExists(strFilePath) Then objFSO.CreateTextFile(strFilePath)
 
  '// Add this line to the file
  Set txtStream = objFSO.OpenTextFile(strFilePath, 8)
  txtStream.WriteLine Text
  txtStream.Close
End Sub

Sub SayOutput
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  strFilePath = filePath

  '// Create the file if it doesn't exist
  If Not objFSO.FileExists(strFilePath) Then objFSO.CreateTextFile(strFilePath)

  '// Get the file
  Set objFile = objFSO.GetFile(strFilePath)

  '// Check if it is empty
  If objFile.Size > 0 Then
    '// Get the content
    Set txtStream = objFile.OpenAsTextStream(1)
    fileContent = txtStream.ReadAll
    fileContent = Split(fileContent, vbNewLine)
    txtStream.Close
    '// Loop through the content
    For i = 0 To UBound(fileContent)
      '// Output the first line
      AddQ fileContent(i)
      '// Exit so that we only get one line per execution
      Exit For
    Next
    '// Remove our line from the content
    fileContent = RemoveFromArray(i)
    '// Put the array back into a large string
    fileContent = Join(fileContent, vbNewLine) & vbNewLine
    '// Write our new content to the file with the line said removed
    Set txtStream = objFile.OpenAsTextStream(2)
    txtStream.Write fileContent
    txtStream.Close
  End If
End Sub

Function RemoveFromArray(index, array)
  If Not isArray(array) Then Exit Function
  If index > Ubound(array) Then Exit Function
  array(index) = ""

  For i=0 to Ubound(array)
    If array(i) <> "" Then str = str & array(i) & "|"
  Next
  str = Left(str, Len(str) - 1))

  RemoveFromArray = Split(str, "|")
End Function
*Untested Example*
« Last Edit: October 28, 2008, 03:54:40 PM by Hero »
Hero
AKA: HeroAssasin and Mike
- - - - -  - - -
Visit Clan R77
- - - - -  - - -
Please do not PM me with random questions. That is what I made these forums for.

Noob ~Vector

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
QQ
« Reply #4 on: October 29, 2008, 12:34:06 PM »
I successfully had two bots with two different scripts interact with each other. I would tell the one bot to join a channel, and feed the results of that channel to the second bot to display in channel. It worked pretty good.
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector