<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.secondlife.com/w/index.php?action=history&amp;feed=atom&amp;title=Presence_Code_Python_cmd_line</id>
	<title>Presence Code Python cmd line - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.secondlife.com/w/index.php?action=history&amp;feed=atom&amp;title=Presence_Code_Python_cmd_line"/>
	<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Presence_Code_Python_cmd_line&amp;action=history"/>
	<updated>2026-07-26T18:23:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Presence_Code_Python_cmd_line&amp;diff=1205899&amp;oldid=prev</id>
		<title>Chaser Zaks: Formatting repair</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Presence_Code_Python_cmd_line&amp;diff=1205899&amp;oldid=prev"/>
		<updated>2017-06-27T15:32:50Z</updated>

		<summary type="html">&lt;p&gt;Formatting repair&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:32, 27 June 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This [[Presence_Code_Python_cmd_line_controller| sample control script]] currently only starts the login script with avatar name and password.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This [[Presence_Code_Python_cmd_line_controller| sample control script]] currently only starts the login script with avatar name and password.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;python&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight lang=&quot;&lt;/ins&gt;python&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;from struct import *&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;from struct import *&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;from zerocode import  *&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;from zerocode import  *&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l356&quot;&gt;Line 356:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 356:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;python&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: AW Groupies]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: AW Groupies]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Chaser Zaks</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Presence_Code_Python_cmd_line&amp;diff=996442&amp;oldid=prev</id>
		<title>New Spore at 05:45, 9 August 2010</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Presence_Code_Python_cmd_line&amp;diff=996442&amp;oldid=prev"/>
		<updated>2010-08-09T05:45:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://wiki.secondlife.com/w/index.php?title=Presence_Code_Python_cmd_line&amp;amp;diff=996442&amp;amp;oldid=66047&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>New Spore</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Presence_Code_Python_cmd_line&amp;diff=66047&amp;oldid=prev</id>
		<title>Saijanai Kuhn at 19:01, 5 May 2008</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Presence_Code_Python_cmd_line&amp;diff=66047&amp;oldid=prev"/>
		<updated>2008-05-05T19:01:45Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:01, 5 May 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is a variation of the login presence code that parses the argument list for name, password and eventually url, and uses those if they exist. This allows for automated testing. The URL will eventually be used by a micro-http-server that will accept POST messages from the controlling script and parse them as commands, and return the result of that command in the http response. These could be command line style commands, or some more formal list designed for use with a GUI. THis strategy allows for extremely loose coupling of a distributed test harness.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is a variation of the login presence code that parses the argument list for name, password and eventually url, and uses those if they exist. This allows for automated testing. The URL will eventually be used by a micro-http-server that will accept POST messages from the controlling script and parse them as commands, and return the result of that command in the http response. These could be command line style commands, or some more formal list designed for use with a GUI. THis strategy allows for extremely loose coupling of a distributed test harness.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;A &lt;/del&gt;sample control script &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;that simply &lt;/del&gt;starts the login script with avatar name&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/del&gt;password &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;can be found here. A better version would also specify for startup location. That may be added later on&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;This [[Presence_Code_Python_cmd_line_controller| &lt;/ins&gt;sample control script&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]] currently only &lt;/ins&gt;starts the login script with avatar name &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;and &lt;/ins&gt;password.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;python&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;python&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Saijanai Kuhn</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Presence_Code_Python_cmd_line&amp;diff=66044&amp;oldid=prev</id>
		<title>Saijanai Kuhn: New page: This is a variation of the login presence code that parses the argument list for name, password and eventually url, and uses those if they exist. This allows for automated testing. The URL...</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Presence_Code_Python_cmd_line&amp;diff=66044&amp;oldid=prev"/>
		<updated>2008-05-05T18:46:06Z</updated>

		<summary type="html">&lt;p&gt;New page: This is a variation of the login presence code that parses the argument list for name, password and eventually url, and uses those if they exist. This allows for automated testing. The URL...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is a variation of the login presence code that parses the argument list for name, password and eventually url, and uses those if they exist. This allows for automated testing. The URL will eventually be used by a micro-http-server that will accept POST messages from the controlling script and parse them as commands, and return the result of that command in the http response. These could be command line style commands, or some more formal list designed for use with a GUI. THis strategy allows for extremely loose coupling of a distributed test harness.&lt;br /&gt;
&lt;br /&gt;
A sample control script that simply starts the login script with avatar name, password can be found here. A better version would also specify for startup location. That may be added later on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;python&amp;gt;&lt;br /&gt;
from struct import *&lt;br /&gt;
from zerocode import  *&lt;br /&gt;
import md5&lt;br /&gt;
import xmlrpclib&lt;br /&gt;
import sys &lt;br /&gt;
&lt;br /&gt;
import re&lt;br /&gt;
import httplib, urllib        &lt;br /&gt;
from urlparse import urlparse    &lt;br /&gt;
import socket, sys, time&lt;br /&gt;
import uuid&lt;br /&gt;
from makepacketdict import makepacketdict&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
from datetime import datetime&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mypacketdictionary = {}&lt;br /&gt;
outputstring = &amp;#039;&amp;#039;&lt;br /&gt;
ack_need_list = []&lt;br /&gt;
&lt;br /&gt;
logoutputflag = False&lt;br /&gt;
&lt;br /&gt;
if logoutputflag:&lt;br /&gt;
    temp = sys.stdout&lt;br /&gt;
    sys.stdout =open(&amp;#039;alog.txt&amp;#039;,&amp;#039;w&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
def login(first, last, passwd, mac):&lt;br /&gt;
  passwd_md5 = &amp;#039;$1$&amp;#039; + md5.new(passwd).hexdigest()&lt;br /&gt;
 &lt;br /&gt;
  uri = &amp;#039;http://127.0.0.1&amp;#039;&lt;br /&gt;
  uri = &amp;#039;https://login.agni.lindenlab.com/cgi-bin/login.cgi&amp;#039;&lt;br /&gt;
  #uri = &amp;#039;https://login.aditi.lindenlab.com/cgi-bin/login.cgi&amp;#039;&lt;br /&gt;
  s = xmlrpclib.ServerProxy(uri)&lt;br /&gt;
 &lt;br /&gt;
  login_details = {&lt;br /&gt;
    &amp;#039;first&amp;#039;: first,&lt;br /&gt;
    &amp;#039;last&amp;#039;: last,&lt;br /&gt;
    &amp;#039;passwd&amp;#039;: passwd_md5,&lt;br /&gt;
    #&amp;#039;start&amp;#039;: &amp;#039;uri:Sandbox Goguen MONO&amp;amp;133&amp;amp;111&amp;amp;21&amp;#039;,&lt;br /&gt;
    &amp;#039;start&amp;#039;: &amp;#039;uri:Stadt&amp;amp;203&amp;amp;78&amp;amp;23&amp;#039;,&lt;br /&gt;
    &amp;#039;major&amp;#039;: &amp;#039;1&amp;#039;,&lt;br /&gt;
    #&amp;#039;minor&amp;#039;: &amp;#039;20&amp;#039;,&lt;br /&gt;
    #&amp;#039;patch&amp;#039;: &amp;#039;0&amp;#039;,&lt;br /&gt;
    #&amp;#039;build&amp;#039;: &amp;#039;86489&amp;#039;,&lt;br /&gt;
    &amp;#039;minor&amp;#039;: &amp;#039;19&amp;#039;,&lt;br /&gt;
    &amp;#039;patch&amp;#039;: &amp;#039;1&amp;#039;,&lt;br /&gt;
    &amp;#039;build&amp;#039;: &amp;#039;4&amp;#039;,&lt;br /&gt;
    &amp;#039;platform&amp;#039;: &amp;#039;Win&amp;#039;,&lt;br /&gt;
    &amp;#039;mac&amp;#039;: mac,&lt;br /&gt;
    &amp;#039;options&amp;#039;: [],&lt;br /&gt;
    &amp;#039;user-agent&amp;#039;: &amp;#039;&amp;#039;,&lt;br /&gt;
    &amp;#039;id0&amp;#039;: &amp;#039;&amp;#039;,&lt;br /&gt;
    &amp;#039;agree_to_tos&amp;#039;: &amp;#039;Yes&amp;#039;,&lt;br /&gt;
    &amp;#039;viewer_digest&amp;#039;: &amp;#039;09d93740-8f37-c418-fbf2-2a78c7b0d1ea&amp;#039;&lt;br /&gt;
  }&lt;br /&gt;
  results = s.login_to_simulator(login_details)&lt;br /&gt;
  print results&lt;br /&gt;
  &lt;br /&gt;
  return results&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def get_caps(results,cap_key, request_keys):&lt;br /&gt;
&lt;br /&gt;
  _, netloc, path, _, _, _ = urlparse(results[cap_key])&lt;br /&gt;
&lt;br /&gt;
  params = &amp;quot;&amp;lt;llsd&amp;gt;&amp;lt;array&amp;gt;&amp;lt;string&amp;gt;&amp;quot;+ request_keys[0]+&amp;quot;&amp;lt;/string&amp;gt;&amp;lt;/array&amp;gt;&amp;lt;/llsd&amp;gt;&amp;quot;&lt;br /&gt;
  headers = {&amp;quot;content-type&amp;quot;: &amp;quot;application/xml&amp;quot;}&lt;br /&gt;
  conn = httplib.HTTPSConnection(netloc)&lt;br /&gt;
&lt;br /&gt;
  conn.request(&amp;quot;POST&amp;quot;, path, params, headers)&lt;br /&gt;
  response = conn.getresponse()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  data = response.read()&lt;br /&gt;
  conn.close()&lt;br /&gt;
  return data&lt;br /&gt;
  &lt;br /&gt;
def ExtractCap(cap_result):&lt;br /&gt;
  trim_xml = re.compile(r&amp;quot;&amp;lt;key&amp;gt;([a-zA-Z_]+)&amp;lt;/key&amp;gt;&amp;lt;string&amp;gt;([a-zA-Z_:/0-9-.]+)&amp;lt;/string&amp;gt;&amp;quot;)&lt;br /&gt;
  new_key = trim_xml.search(cap_result).group(1)&lt;br /&gt;
  new_cap = trim_xml.search(cap_result).group(2)&lt;br /&gt;
  return new_key, new_cap&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
def scheduleacknowledgemessage(data):&lt;br /&gt;
    if not (ord(data[0])&amp;amp;0x40):&lt;br /&gt;
        print &amp;quot;OOOPS! Got asked to ack a message that shouldn&amp;#039;t be acked&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
        return&lt;br /&gt;
    else:&lt;br /&gt;
        ID = data[1:5]&lt;br /&gt;
        if (ord(data[0])&amp;amp;0x40) &amp;amp; 0x80: ID = zero_decode_ID(ID)&lt;br /&gt;
        ack_need_list.append(unpack(&amp;quot;&amp;gt;L&amp;quot;,ID)[0])&lt;br /&gt;
        #ack_need_list.append(unpack(&amp;quot;&amp;gt;L&amp;quot;,data[1:5])[0])&lt;br /&gt;
        #print &amp;quot;ack needed&amp;quot;,&amp;quot;insdie schedule ack_need_list&amp;quot;, ack_need_list&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
    return&lt;br /&gt;
&lt;br /&gt;
def packacks():&lt;br /&gt;
    acksequence = &amp;quot;&amp;quot;&lt;br /&gt;
    for msgnum in ack_need_list:&lt;br /&gt;
        acksequence = acksequence + pack(&amp;quot;&amp;lt;L&amp;quot;, msgnum)&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    return acksequence&lt;br /&gt;
        &lt;br /&gt;
#def sendacks():&lt;br /&gt;
 #   if len(ack_need_list)&amp;gt;0:&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
#===============================================================================&lt;br /&gt;
# {&lt;br /&gt;
#    UUIDNameRequest Low NotTrusted Unencoded&lt;br /&gt;
#    {&lt;br /&gt;
#        UUIDNameBlock    Variable&lt;br /&gt;
#        {    ID            LLUUID    }&lt;br /&gt;
#    }&lt;br /&gt;
# }&lt;br /&gt;
#===============================================================================&lt;br /&gt;
&lt;br /&gt;
def sendUUIDNameRequest(sock, port, host, currentsequence,aUUID):&lt;br /&gt;
    &lt;br /&gt;
    packed_data = &amp;quot;&amp;quot;&lt;br /&gt;
    fix_ID = int(&amp;quot;0xffff0000&amp;quot;,16)+ 235&lt;br /&gt;
    data_header = pack(&amp;#039;&amp;gt;BLB&amp;#039;, 0x00,currentsequence,0x00) &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    for i in range(len(aUUID)):&lt;br /&gt;
        packed_data = packed_data+uuid.UUID(aUUID[i]).bytes&lt;br /&gt;
        &lt;br /&gt;
    packed_data = data_header + pack(&amp;quot;L&amp;quot;,fix_ID) + pack(&amp;quot;&amp;gt;B&amp;quot;,len(aUUID)) + packed_data&lt;br /&gt;
        &lt;br /&gt;
    sock.sendto(packed_data, (host, port)) &lt;br /&gt;
    return              &lt;br /&gt;
   &lt;br /&gt;
def sendRegionHandshakeReply(sock, port, host, currentsequence,agentUUID,sessionUUID):&lt;br /&gt;
    packed_data = &amp;quot;&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    low_ID = &amp;quot;0xffff00%2x&amp;quot; % 149&lt;br /&gt;
    data_header = pack(&amp;#039;&amp;gt;BLB&amp;#039;, 0x00,currentsequence,0x00)&lt;br /&gt;
    packed_data = packed_data+uuid.UUID(agentUUID).bytes+uuid.UUID(sessionUUID).bytes+ pack(&amp;quot;&amp;gt;L&amp;quot;,0x00)&lt;br /&gt;
    packed_data = data_header + pack(&amp;quot;&amp;gt;L&amp;quot;,int(low_ID,16))+packed_data&lt;br /&gt;
    sock.sendto(packed_data, (host, port)) &lt;br /&gt;
    #print &amp;quot;RegionHandshakeReply&amp;quot;, ByteToHex(packed_data)&lt;br /&gt;
    return&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
        &lt;br /&gt;
def sendAgentUpdate(sock, port, host, currentsequence, result):&lt;br /&gt;
&lt;br /&gt;
#AgentUpdate&lt;br /&gt;
&lt;br /&gt;
    tempacks = packacks()&lt;br /&gt;
    del ack_need_list[0:]&lt;br /&gt;
    if tempacks == &amp;quot;&amp;quot;: &lt;br /&gt;
        flags = 0x00&lt;br /&gt;
    else:&lt;br /&gt;
        flags = 0x10&lt;br /&gt;
&lt;br /&gt;
    #print &amp;quot;tempacks is:&amp;quot;, ByteToHex(tempacks)  &lt;br /&gt;
        &lt;br /&gt;
    data_header = pack(&amp;#039;&amp;gt;BLB&amp;#039;, flags,currentsequence,0x00)&lt;br /&gt;
    packed_data_message_ID = pack(&amp;#039;&amp;gt;B&amp;#039;,0x04)&lt;br /&gt;
    packed_data_ID = uuid.UUID(result[&amp;quot;agent_id&amp;quot;]).bytes + uuid.UUID(result[&amp;quot;session_id&amp;quot;]).bytes&lt;br /&gt;
    packed_data_QuatRots = pack(&amp;#039;&amp;lt;ffff&amp;#039;, 0.0,0.0,0.0,0.0)+pack(&amp;#039;&amp;lt;ffff&amp;#039;, 0.0,0.0,0.0,0.0)  &lt;br /&gt;
    packed_data_State = pack(&amp;#039;&amp;lt;B&amp;#039;, 0x00)&lt;br /&gt;
    packed_data_Camera = pack(&amp;#039;&amp;lt;fff&amp;#039;, 0.0,0.0,0.0)+pack(&amp;#039;&amp;lt;fff&amp;#039;, 0.0,0.0,0.0)+pack(&amp;#039;&amp;lt;fff&amp;#039;, 0.0,0.0,0.0)+pack(&amp;#039;&amp;lt;fff&amp;#039;, 0.0,0.0,0.0)&lt;br /&gt;
    packed_data_Flags = pack(&amp;#039;&amp;lt;fLB&amp;#039;, 0.0,0x00,0x00)&lt;br /&gt;
&lt;br /&gt;
    encoded_packed_data = zero_encode(packed_data_message_ID+packed_data_ID+packed_data_QuatRots+packed_data_State+packed_data_Camera+packed_data_Flags)&lt;br /&gt;
&lt;br /&gt;
    packed_data = data_header + encoded_packed_data+tempacks&lt;br /&gt;
&lt;br /&gt;
   # print &amp;quot;sending AgentUpdate to server&amp;quot;,ByteToHex(packed_data_header+zero_decode(encoded_packed_data)+ tempacks)&lt;br /&gt;
    &lt;br /&gt;
    sock.sendto(packed_data, (host, port))&lt;br /&gt;
    return&lt;br /&gt;
&lt;br /&gt;
def sendCompletePingCheck(sock, port, host, currentsequence,data,lastPingSent):&lt;br /&gt;
#    print &amp;quot;data from PingCHeck&amp;quot;, ByteToHex(data)&lt;br /&gt;
    &lt;br /&gt;
    data_header = pack(&amp;#039;&amp;gt;BLB&amp;#039;, 0x00,currentsequence,0x00)&lt;br /&gt;
    packed_data_message_ID = pack(&amp;#039;&amp;gt;B&amp;#039;,0x02)&lt;br /&gt;
    packed_data = data_header + packed_data_message_ID+pack(&amp;#039;&amp;gt;B&amp;#039;, lastPingSent)&lt;br /&gt;
    print &amp;quot;CompletePingCheck packet sent:&amp;quot;, ByteToHex(packed_data)&lt;br /&gt;
    sock.sendto(packed_data, (host, port))&lt;br /&gt;
    &lt;br /&gt;
    return&lt;br /&gt;
    &lt;br /&gt;
def sendPacketAck(sock, port, host,currentsequence):&lt;br /&gt;
&lt;br /&gt;
    tempacks = packacks()&lt;br /&gt;
    templen = len(ack_need_list)&lt;br /&gt;
    del ack_need_list[0:]&lt;br /&gt;
    data_header = pack(&amp;#039;&amp;gt;BLB&amp;#039;,0x00,currentsequence,0x00) &lt;br /&gt;
    packed_data_message_ID = pack(&amp;#039;&amp;gt;L&amp;#039;,0xFFFFFFFB)&lt;br /&gt;
    packed_ack_len = pack(&amp;#039;&amp;gt;B&amp;#039;,templen)&lt;br /&gt;
    &lt;br /&gt;
    packed_data = data_header + packed_data_message_ID + packed_ack_len + tempacks&lt;br /&gt;
#===============================================================================&lt;br /&gt;
#    t = datetime.now()&lt;br /&gt;
#    t.strftime(&amp;quot;%H:%M:%S&amp;quot;)&lt;br /&gt;
#    ti = &amp;quot;%02d:%02d:%02d.%06d&amp;quot; % (t.hour,t.minute,t.second,t.microsecond)&lt;br /&gt;
#    print ti, &amp;quot;PacketAck packet sent:&amp;quot;, ByteToHex(packed_data)&lt;br /&gt;
#===============================================================================&lt;br /&gt;
    sock.sendto(packed_data, (host, port))&lt;br /&gt;
    return&lt;br /&gt;
def sendLogoutRequest(sock, port, host,seqnum,aUUID,sUUID):&lt;br /&gt;
    packed_data = &amp;quot;&amp;quot;&lt;br /&gt;
    packed_data_message_ID = pack(&amp;#039;&amp;gt;L&amp;#039;,0xffff00fc)&lt;br /&gt;
    data_header = pack(&amp;#039;&amp;gt;BLB&amp;#039;, 0x00,seqnum,0x00)&lt;br /&gt;
    packed_data = packed_data+uuid.UUID(aUUID).bytes+uuid.UUID(sUUID).bytes+ pack(&amp;quot;&amp;gt;L&amp;quot;,0x00)&lt;br /&gt;
    &lt;br /&gt;
    packed_data = data_header + packed_data_message_ID + packed_data&lt;br /&gt;
    sock.sendto(packed_data, (host, port))&lt;br /&gt;
    return&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def establishpresence(host, port, circuit_code, result):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)&lt;br /&gt;
    &lt;br /&gt;
       &lt;br /&gt;
    myAgentID = result[&amp;quot;agent_id&amp;quot;]&lt;br /&gt;
    mySessionID = result[&amp;quot;session_id&amp;quot;]&lt;br /&gt;
    &lt;br /&gt;
#Sending packet UseCircuitCode &amp;lt;-- Inits the connection to the sim.&lt;br /&gt;
    data = pack(&amp;#039;&amp;gt;BLBL&amp;#039;,0x00,0x01,00,0xffff0003) + pack(&amp;#039;&amp;lt;L&amp;#039;,circuit_code) + uuid.UUID(result[&amp;quot;session_id&amp;quot;]).bytes+uuid.UUID(result[&amp;quot;agent_id&amp;quot;]).bytes&lt;br /&gt;
    sock.sendto(data, (host, port))&lt;br /&gt;
&lt;br /&gt;
#ISending packet CompleteAgentMovement &amp;lt;-- establishes the agent&amp;#039;s presence&lt;br /&gt;
    data = pack(&amp;#039;&amp;gt;BLBL&amp;#039;,0x00,0x02,00,0xffff00f9) + uuid.UUID(result[&amp;quot;agent_id&amp;quot;]).bytes + uuid.UUID(result[&amp;quot;session_id&amp;quot;]).bytes + pack(&amp;#039;&amp;lt;L&amp;#039;, circuit_code)&lt;br /&gt;
    sock.sendto(data, (host, port))&lt;br /&gt;
&lt;br /&gt;
    sendAgentUpdate(sock, port, host, 3, result)&lt;br /&gt;
    aUUID = [result[&amp;quot;agent_id&amp;quot;]]&lt;br /&gt;
    #sendUUIDNameRequest(sock, port, host, 4,aUUID)&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
    buf = 100&lt;br /&gt;
    i = 0&lt;br /&gt;
    trusted_count = 0&lt;br /&gt;
    ackable = 0&lt;br /&gt;
    trusted_and_ackable = 0&lt;br /&gt;
    ack_need_list_changed = False&lt;br /&gt;
    seqnum = 5&lt;br /&gt;
    lastPingSent = 0 &lt;br /&gt;
    trusted = 0&lt;br /&gt;
    while i&amp;lt;300:&lt;br /&gt;
        if ack_need_list_changed:&lt;br /&gt;
            ack_need_list_changed = False&lt;br /&gt;
            seqnum = seqnum + 1&lt;br /&gt;
            sendPacketAck(sock, port, host,seqnum)&lt;br /&gt;
            #sendAgentUpdate(sock, port, host, seqnum, result)&lt;br /&gt;
            seqnum += 1&lt;br /&gt;
        #sendacks()&lt;br /&gt;
        i = i + 1&lt;br /&gt;
        data,addr = sock.recvfrom(buf)&lt;br /&gt;
        t = datetime.now()&lt;br /&gt;
        t.strftime(&amp;quot;%H:%M:%S&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        if not data:&lt;br /&gt;
            print &amp;quot;Client has exited!&amp;quot;&lt;br /&gt;
            &lt;br /&gt;
            break&lt;br /&gt;
        else:&lt;br /&gt;
            test =  ByteToHex(data).split()&lt;br /&gt;
            #print test&lt;br /&gt;
            ID = data[6:12]&lt;br /&gt;
            #print &amp;quot;ID =&amp;quot;, ByteToHex(ID) &lt;br /&gt;
            if (ord(data[0])&amp;amp;0x80): &lt;br /&gt;
                ID = zero_decode_ID(data[6:12])&lt;br /&gt;
                &lt;br /&gt;
            if (ord(data[0])&amp;amp;0x40): &lt;br /&gt;
                scheduleacknowledgemessage(data); &lt;br /&gt;
                ack_need_list_changed = True&lt;br /&gt;
            #print &amp;quot;ID =&amp;quot;, ByteToHex(ID) &lt;br /&gt;
            #print &amp;quot;ID =&amp;quot;, unpack(&amp;quot;&amp;gt;L&amp;quot;, ID[:4])&lt;br /&gt;
            if ID[0] == &amp;#039;\xFF&amp;#039;:&lt;br /&gt;
                if ID[1] == &amp;#039;\xFF&amp;#039;:&lt;br /&gt;
                    if ID[2] == &amp;#039;\xFF&amp;#039;:&lt;br /&gt;
                        myentry = mypacketdictionary[(&amp;quot;Fixed&amp;quot; , &amp;quot;0x&amp;quot;+ByteToHex(ID[0:4]).replace(&amp;#039; &amp;#039;, &amp;#039;&amp;#039;))]&lt;br /&gt;
                        if myentry[1] == &amp;quot;Trusted&amp;quot;:&lt;br /&gt;
                            trusted += 1;&lt;br /&gt;
                        ti = &amp;quot;%02d:%02d:%02d.%06d&amp;quot; % (t.hour,t.minute,t.second,t.microsecond)&lt;br /&gt;
                        print ti, &amp;quot;Message #&amp;quot;, i, &amp;quot;trusted count is&amp;quot;, trusted,&amp;quot;Flags: 0x&amp;quot; + test[0], myentry,  &amp;quot;sequence #&amp;quot;, unpack(&amp;quot;&amp;gt;L&amp;quot;,data[1:5])&lt;br /&gt;
                            &lt;br /&gt;
                        #if myentry[1] == &amp;quot;Trusted&amp;quot;: trusted_count = trusted_count +1;print &amp;quot;number of trusted messages =&amp;quot;, trusted_count&lt;br /&gt;
                        #if (ord(data[0])&amp;amp;0x40) and (myentry[1] == &amp;quot;Trusted&amp;quot;): trusted_and_ackable = trusted_and_ackable + 1; print &amp;quot;trusted_and_ackable =&amp;quot;, trusted_and_ackable&lt;br /&gt;
                        #if (ord(data[0])&amp;amp;0x40): ackable = ackable + 1; print &amp;quot;number of ackable messages = &amp;quot;, ackable&lt;br /&gt;
                    else:&lt;br /&gt;
                        myentry = mypacketdictionary[(&amp;quot;Low&amp;quot;,int(&amp;quot;0x&amp;quot;+ByteToHex(ID[2:4]).replace(&amp;#039; &amp;#039;, &amp;#039;&amp;#039;),16))]&lt;br /&gt;
                        if myentry[1] == &amp;quot;Trusted&amp;quot;:&lt;br /&gt;
                            trusted += 1;&lt;br /&gt;
                        ti = &amp;quot;%02d:%02d:%02d.%06d&amp;quot; % (t.hour,t.minute,t.second,t.microsecond)&lt;br /&gt;
                        print ti, &amp;quot;Message #&amp;quot;, i,&amp;quot;trusted count is&amp;quot;, trusted,&amp;quot;Flags: 0x&amp;quot; + test[0], myentry,   &amp;quot;sequence #&amp;quot;, unpack(&amp;quot;&amp;gt;L&amp;quot;,data[1:5])&lt;br /&gt;
                        if myentry[0] == &amp;quot;UUIDNameReply&amp;quot;:&lt;br /&gt;
                            pass&lt;br /&gt;
                            #print ByteToHex(data)&lt;br /&gt;
                            #print data[:28]&lt;br /&gt;
                            #print data[28:36],data[38:45]&lt;br /&gt;
                        elif myentry[0] == &amp;quot;RegionHandshake&amp;quot;:&lt;br /&gt;
                            sendRegionHandshakeReply(sock, port, host, seqnum,result[&amp;quot;agent_id&amp;quot;],result[&amp;quot;session_id&amp;quot;])&lt;br /&gt;
                            seqnum += 1&lt;br /&gt;
                        &lt;br /&gt;
                        #if myentry[1] == &amp;quot;Trusted&amp;quot;: trusted_count = trusted_count +1;print &amp;quot;number of trusted messages =&amp;quot;, trusted_count&lt;br /&gt;
                        #if (ord(data[0])&amp;amp;0x40) and (myentry[1] == &amp;quot;Trusted&amp;quot;): trusted_and_ackable = trusted_and_ackable + 1; print &amp;quot;trusted_and_ackable =&amp;quot;, trusted_and_ackable&lt;br /&gt;
                       #if (ord(data[0])&amp;amp;0x40): ackable = ackable + 1; print &amp;quot;number of ackable messages = &amp;quot;, ackable&lt;br /&gt;
                else:&lt;br /&gt;
                    myentry = mypacketdictionary[(&amp;quot;Medium&amp;quot;, int(&amp;quot;0x&amp;quot;+ByteToHex(ID[1:2]).replace(&amp;#039; &amp;#039;, &amp;#039;&amp;#039;),16))]&lt;br /&gt;
                    if myentry[1] == &amp;quot;Trusted&amp;quot;:&lt;br /&gt;
                        trusted += 1;&lt;br /&gt;
                    ti = &amp;quot;%02d:%02d:%02d.%06d&amp;quot; % (t.hour,t.minute,t.second,t.microsecond)&lt;br /&gt;
                    print ti, &amp;quot;Message #&amp;quot;, i,&amp;quot;trusted count is&amp;quot;, trusted,&amp;quot;Flags: 0x&amp;quot; + test[0], myentry,  &amp;quot;sequence #&amp;quot;, unpack(&amp;quot;&amp;gt;L&amp;quot;,data[1:5])&lt;br /&gt;
                    &lt;br /&gt;
                    &lt;br /&gt;
                    #if myentry[1] == &amp;quot;Trusted&amp;quot;: trusted_count = trusted_count +1;print &amp;quot;number of trusted messages =&amp;quot;, trusted_count&lt;br /&gt;
                    #if (ord(data[0])&amp;amp;0x40) and (myentry[1] == &amp;quot;Trusted&amp;quot;): trusted_and_ackable = trusted_and_ackable + 1; print &amp;quot;trusted_and_ackable =&amp;quot;, trusted_and_ackable&lt;br /&gt;
                    #if (ord(data[0])&amp;amp;0x40): ackable = ackable + 1; print &amp;quot;number of ackable messages = &amp;quot;, ackable&lt;br /&gt;
            else:&lt;br /&gt;
                myentry = mypacketdictionary[(&amp;quot;High&amp;quot;, int(&amp;quot;0x&amp;quot;+ByteToHex(ID[0]), 16))]&lt;br /&gt;
                if myentry[0] == &amp;quot;StartPingCheck&amp;quot;: &lt;br /&gt;
                    print &amp;quot;data from StartPingCheck&amp;quot;, test&lt;br /&gt;
                    sendCompletePingCheck(sock, port, host, seqnum,data,lastPingSent)&lt;br /&gt;
                    lastPingSent = lastPingSent+  1&lt;br /&gt;
                    seqnum = seqnum + 1&lt;br /&gt;
                    &lt;br /&gt;
                if myentry[1] == &amp;quot;Trusted&amp;quot;:&lt;br /&gt;
                    trusted += 1;   &lt;br /&gt;
                ti = &amp;quot;%02d:%02d:%02d.%06d&amp;quot; % (t.hour,t.minute,t.second,t.microsecond)&lt;br /&gt;
                &lt;br /&gt;
                print ti, &amp;quot;Message #&amp;quot;, i,&amp;quot;trusted count is&amp;quot;, trusted,&amp;quot;Flags: 0x&amp;quot; + test[0], myentry,   &amp;quot;sequence #&amp;quot;, unpack(&amp;quot;&amp;gt;L&amp;quot;,data[1:5])&lt;br /&gt;
                &lt;br /&gt;
                #if myentry[1] == &amp;quot;Trusted&amp;quot;: trusted_count = trusted_count +1;print &amp;quot;number of trusted messages =&amp;quot;, trusted_count&lt;br /&gt;
                #if (ord(data[0])&amp;amp;0x40) and (myentry[1] == &amp;quot;Trusted&amp;quot;): trusted_and_ackable = trusted_and_ackable + 1; print &amp;quot;trusted_and_ackable =&amp;quot;,  trusted_and_ackable&lt;br /&gt;
                #if (ord(data[0])&amp;amp;0x40): ackable = ackable + 1; print &amp;quot;number of ackable messages = &amp;quot;, ackable&lt;br /&gt;
    &lt;br /&gt;
    sendLogoutRequest(sock, port, host,seqnum,myAgentID,mySessionID)&lt;br /&gt;
    sock.close()&lt;br /&gt;
    print &amp;quot;final number of trusted messages =&amp;quot;, trusted_count&lt;br /&gt;
    &lt;br /&gt;
    return&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
argsList = sys.argv  &lt;br /&gt;
&lt;br /&gt;
if len(argsList) == 4:     # POST handler not implemented yet&lt;br /&gt;
    myResult = login(argsList[1], argsList[2], argsList[3], &amp;quot;01:02:03:04:05:06&amp;quot;)&lt;br /&gt;
else:                       #simple hard-coded startup&lt;br /&gt;
    myResult = login(&amp;quot;first&amp;quot;, &amp;quot;last&amp;quot;, &amp;quot;password&amp;quot;, &amp;quot;01:02:03:04:05:06&amp;quot;)    #note fake MAC&lt;br /&gt;
mypacketdictionary = makepacketdict()&lt;br /&gt;
&lt;br /&gt;
myhost = myResult[&amp;quot;sim_ip&amp;quot;]&lt;br /&gt;
myport = myResult[&amp;quot;sim_port&amp;quot;]&lt;br /&gt;
mycircuit_code = myResult[&amp;quot;circuit_code&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
establishpresence(myhost, myport, mycircuit_code, myResult)&lt;br /&gt;
&lt;br /&gt;
#cap_out = get_caps(result,&amp;quot;seed_capability&amp;quot;, [&amp;quot;ChatSessionRequest&amp;quot;])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/python&amp;gt;&lt;br /&gt;
[[Category: AW Groupies]]&lt;/div&gt;</summary>
		<author><name>Saijanai Kuhn</name></author>
	</entry>
</feed>