Wednesday, January 6, 2016

XOS Simulator Work



Working on the ROV simulator, had never demo'd the old versions onhere but here is pic

Alot of my updates have been over at http://www.rovx.xyz

Hiding Information in Locations

Okay Lets hack a google spreadsheet, I'll explain in a minute:


Notice this part is what stays constant in different google forms:

    <div class="ss-form"><form action="https://docs.google.com/forms/d/YOUR CODE/formResponse" method="POST" id="ss-form" target="_self" onsubmit=""><ol role="list" class="ss-question-list" style="padding-left: 0">
<div class="ss-form-question errorbox-good" role="listitem">
<div dir="auto" class="ss-item  ss-text"><div class="ss-form-entry">
<label class="ss-q-item-label" for="entry_464585175"><div class="ss-q-title">Description
</div>
<div class="ss-q-help ss-secondary-text" dir="auto"></div></label>
<input type="text" name="entry.464585175" value="" class="ss-q-short" id="entry_464585175" dir="auto" aria-label="Description  " title="">
<div class="error-message" id="667802394_errorMessage"></div>
<div class="required-message">This is a required question</div>
</div></div></div> <div class="ss-form-question errorbox-good" role="listitem">
<div dir="auto" class="ss-item  ss-text"><div class="ss-form-entry">
<label class="ss-q-item-label" for="entry_1801456818"><div class="ss-q-title">Lat
</div>
<div class="ss-q-help ss-secondary-text" dir="auto"></div></label>
<input type="text" name="entry.1801456818" value="" class="ss-q-short" id="entry_1801456818" dir="auto" aria-label="Lat  " title="">
<div class="error-message" id="1641482710_errorMessage"></div>
<div class="required-message">This is a required question</div>
</div></div></div> <div class="ss-form-question errorbox-good" role="listitem">
<div dir="auto" class="ss-item  ss-text"><div class="ss-form-entry">
<label class="ss-q-item-label" for="entry_1412176452"><div class="ss-q-title">Long
</div>
<div class="ss-q-help ss-secondary-text" dir="auto"></div></label>
<input type="text" name="entry.1412176452" value="" class="ss-q-short" id="entry_1412176452" dir="auto" aria-label="Long  " title="">
<div class="error-message" id="733292993_errorMessage"></div>
<div class="required-message">This is a required question</div>
</div></div></div>
<input type="hidden" name="draftResponse" value="[,,&quot;-7722594897214563767&quot;]
">
<input type="hidden" name="pageHistory" value="0">

<input type="hidden" name="fvv" value="0">


<input type="hidden" name="fbzx" value="-7722594897214563767">

<div class="ss-item ss-navigate"><table id="navigation-table"><tbody><tr><td class="ss-form-entry goog-inline-block" id="navigation-buttons" dir="ltr">
<input type="submit" name="submit" value="Submit" id="ss-submit" class="jfk-button jfk-button-action ">
<div class="ss-password-warning ss-secondary-text">Never submit passwords through Google Forms.</div></td>
</tr></tbody></table></div></ol></form></div>
</html>

with some variation in different constants(the alphanumeric strings).

Now to access the form in JS


Preview (hint: you can copy and paste the preview into Microsoft Word):
document.getElementById("entry_1801456818").value=event.latLng.lat();
     document.getElementById("entry_1412176452").value=event.latLng.lng();
       document.getElementById("entry_464585175").value=document.getElementById("text").value;
       document.getElementById('ss-submit').click();

Which causes button clicks like we did in the famous (kidding) facebook hacks. Okay now we
 can hook up a map to this, why? We can hide information at locations so that a client cannot 
access until at a location which might be useful in some interesting scenarios.


Okay so we add a map to our spreadsheet site and hide all the form stuff:

<!DOCTYPE html>
<html>
  <head>
    <title>HackAsheeT</title>
    <style>
      html, body {
        height: 100%;
        margin: 0;
        padding: 0;
      }
      #map {
        height: 100%;
      }
#floating-panel {
  position: absolute;
  top: 10px;
  left: 25%;
  z-index: 5;
  background-color: transparent;
  padding: 5px;
  border: 1px solid #999;
  text-align: center;
  font-family: 'Roboto','sans-serif';
  line-height: 30px;
  padding-left: 10px;
  
}

    </style>
  </head>
  <body>
    <div id="floating-panel">
      <img src="trash.png" onclick="deleteMarkers();" width="20px" height="20px">
     
      <img src="usercompass.png" onclick="getit();" width="20px" height="20px">
    <input type="text" id="text">
    </div>
    <div id="map"></div>
    <p>Click on the map to add markers.</p>
    <script>

// In the following example, markers appear when the user clicks on the map.
// The markers are stored in an array.
// The user can then click an option to hide, show or delete the markers.
var map;
var markers = [];

function initMap() {
  var haightAshbury = {lat: 37.769, lng: -122.446};

  map = new google.maps.Map(document.getElementById('map'), {
    zoom: 12,
    center: haightAshbury,
    mapTypeId: google.maps.MapTypeId.TERRAIN
  });

  // This event listener will call addMarker() when the map is clicked.
  map.addListener('click', function(event) {
    addMarker(event.latLng);
 
      
      
    document.getElementById("entry_1801456818").value=event.latLng.lat();
     document.getElementById("entry_1412176452").value=event.latLng.lng();
       document.getElementById("entry_464585175").value=document.getElementById("text").value;
       document.getElementById('ss-submit').click();
  });

  // Adds a marker at the center of the map.
  addMarker(haightAshbury);
}

// Adds a marker to the map and push to the array.
function addMarker(location) {
  var marker = new google.maps.Marker({
    position: location,
    map: map
  });
  markers.push(marker);
}

// Sets the map on all markers in the array.
function setMapOnAll(map) {
  for (var i = 0; i < markers.length; i++) {
    markers[i].setMap(map);
  }
}

// Removes the markers from the map, but keeps them in the array.
function clearMarkers() {
  setMapOnAll(null);
}

// Shows any markers currently in the array.
function showMarkers() {
  setMapOnAll(map);
}

// Deletes all markers in the array by removing references to them.
function deleteMarkers() {
  clearMarkers();
  markers = [];
}
function getit(){
    

}
    </script>
    <script async defer
        src="https://maps.googleapis.com/maps/api/js?key=urkeyin=true&callback=initMap"></script>
  </body>
    
    <div class="ss-form"><form action="form" method="POST" id="ss-form" target="_self" onsubmit=""><ol role="list" class="ss-question-list" style="padding-left: 0">
<div class="ss-form-question errorbox-good" role="listitem">
<div dir="auto" class="ss-item  ss-text"><div class="ss-form-entry">
<label class="ss-q-item-label" for="entry_464585175"><div class="ss-q-title">Description
</div>
<div class="ss-q-help ss-secondary-text" dir="auto"></div></label>
<input type="text" name="entry.464585175" value="" class="ss-q-short" id="entry_464585175" dir="auto" aria-label="Description  " title="">
<div class="error-message" id="667802394_errorMessage"></div>
<div class="required-message">This is a required question</div>
</div></div></div> <div class="ss-form-question errorbox-good" role="listitem">
<div dir="auto" class="ss-item  ss-text"><div class="ss-form-entry">
<label class="ss-q-item-label" for="entry_1801456818"><div class="ss-q-title">Lat
</div>
<div class="ss-q-help ss-secondary-text" dir="auto"></div></label>
<input type="text" name="entry.1801456818" value="" class="ss-q-short" id="entry_1801456818" dir="auto" aria-label="Lat  " title="">
<div class="error-message" id="1641482710_errorMessage"></div>
<div class="required-message">This is a required question</div>
</div></div></div> <div class="ss-form-question errorbox-good" role="listitem">
<div dir="auto" class="ss-item  ss-text"><div class="ss-form-entry">
<label class="ss-q-item-label" for="entry_1412176452"><div class="ss-q-title">Long
</div>
<div class="ss-q-help ss-secondary-text" dir="auto"></div></label>
<input type="text" name="entry.1412176452" value="" class="ss-q-short" id="entry_1412176452" dir="auto" aria-label="Long  " title="">
<div class="error-message" id="733292993_errorMessage"></div>
<div class="required-message">This is a required question</div>
</div></div></div>
<input type="hidden" name="draftResponse" value="[,,&quot;-7722594897214563767&quot;]
">
<input type="hidden" name="pageHistory" value="0">

<input type="hidden" name="fvv" value="0">


<input type="hidden" name="fbzx" value="-7722594897214563767">

<div class="ss-item ss-navigate"><table id="navigation-table"><tbody><tr><td class="ss-form-entry goog-inline-block" id="navigation-buttons" dir="ltr">
<input type="submit" name="submit" value="Submit" id="ss-submit" class="jfk-button jfk-button-action ">
<div class="ss-password-warning ss-secondary-text">Never submit passwords through Google Forms.</div></td>
</tr></tbody></table></div></ol></form></div>
</html>

Now that peice of garbage will add data to our spreadsheet with location and 
whatever we ut in the text box we made, I am not going to walk through building
 the form or the spreadsheet.



Now our "client" code:

Okay we are going to use a js lib called sheetrock.js and make a call to it to
 grab stuff from our hacked spreadsheet and dump it into a <div> based html table.
<!DOCTYPE html>
<html> 
<head> 
    
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> 
  <title>QWest</title> 
    
    
    
  <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
  <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.1.min.js"></script>
  <script src="//maps.googleapis.com/maps/api/js?v=3.exp&sensor=true"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-sheetrock/1.0.0/dist/sheetrock.min.js"></script>  

    
    <style>
      html, body, #map-canvas {
        height: 100%;
        margin: 0px;
        padding: 0px
      }
      #panel {
        position: absolute;
        top: 5px;
        margin-left: auto;
  margin-right: auto;
       left:30px;
           right:auto;
        z-index: 5;
        background-color: #FFF;
        padding: 5px;
        border: 1px solid transparent;
          opacity: .9;
          align-content: center;
      }
        input{
            border: none;
border-color: transparent;
            border-style:none;
             -webkit-box-shadow: none;
    -moz-box-shadow: none;
    box-shadow: none;
            
    overflow: auto;
    outline: none;

        }
        
         #holder{
              position: absolute;
        top: 5px;
        right: 0%;
        margin-left: 0;
        z-index: 5;
        background-color: transparent;
        padding: 5px;
        border: transparent;
          opacity: .8;
          align-content: left;
        }
         
         #holdertwo{
              position: absolute;
        top: 55px;
        right: 0%;
        margin-left: 0;
        z-index: 5;
        background-color: transparent;
        padding: 5px;
        border: transparent;
          opacity: .8;
          align-content: left;
        }

               statistics, tr{
         
    border-color: lighten(#34495E, 10%);
  
        }
    statistics,  td {
        
    border: 0px solid grey;
        border-radius: 5px;
    border-collapse: separate;
    background-color:#34495E;
    font-family:monospace;
         color: white;
}
        statistics,th{
                border: 0px solid grey;
        border-radius: 5px;
    border-collapse: separate;
    background-color:#000;
    font-family:monospace;
         color: white;
            
            
        }
    </style>
    
    
    
    
</head> 
<body onload="showtog()">
    <div id="holder">
    <img src="hackericon.png" width="50" height="50" align="left" onclick="showtwo()"><br>
  
        </div>
    <div id="holdertwo">
      <img src="usercompass.png" width="50" height="50" align ="left" onclick="showtog()"><br>
    <img src="facebookapipic.jpg" width="50" height="50" align="left" onclick="gof()">
    </div>
    <div id="tabler">
      <table id="statistics" class="table table-striped table-hover" ></table>
       
          </div>
    
    
    <script>
        
        function showtwo(){
            $('#holdertwo').fadeToggle(); 
            
        }
     function showtog(){
  
 $('#tabler').fadeToggle();
  

}
        function gof(){
         window.open("https://m.facebook.com/buddylist.php")  ;
        }
        
</script>
    
    
  
  <div id="map" style="width: 100%; height: 100%;"></div>

  <script type="text/javascript">
     /* 
      var table = document.getElementById('tabler'), 
    rows = table.getElementsByTagName('tr'),
    i, j, cells, customerId;

for (i = 0, j = rows.length; i < j; ++i) {
    cells = rows[i].getElementsByTagName('td');
    if (!cells.length) {
        continue;
    }
    customerId = cells[0].innerHTML;
}
      */
      
      
      
      
      
    var locations = [
    
['Tisch Library',42.406561, -71.119475  ],
['Bookstore',   42.405737   -71.120344  ],
['Dewick',  42.405294,  -71.121106  ],
['Cannon',  42.407167,  -71.119857  ],
['Campus Center',   42.405809   ,-71.119681 ],
['Arts Center', 42.404755   ,-71.118764 ],
['Gym'  ,42.408966  ,-71.114869 ],
['Residential Quad' ,42.408407  ,-71.121718 ],
['Academic Quad'    ,42.407583  ,-71.119586]
    ];
    var map = new google.maps.Map(document.getElementById('map'), {
      zoom: 3,
      center: new google.maps.LatLng(-39.92, 151.25),
      mapTypeId: google.maps.MapTypeId.ROADMAP,
       // disableDefaultUI: true
    });
      

    
    var infowindow = new google.maps.InfoWindow();
    var marker, i;

    var markers = new Array();
    for (i = 0; i < locations.length; i++) {  
      marker = new google.maps.Marker({
        position: new google.maps.LatLng(locations[i][1], locations[i][2]),
        map: map
      });
      markers.push(marker);
      google.maps.event.addListener(marker, 'click', (function(marker, i) {
        return function() {
          infowindow.setContent(locations[i][0]);
          infowindow.open(map, marker);
            window.setTimeout(function snappy(){marker.setVisible(false);infowindow.close();}, 2000);
            
        }
      })(marker, i));
    }
        AutoCenter();
      map.setZoom(3);
    function AutoCenter() {
      //  Create a new viewpoint bound
      var bounds = new google.maps.LatLngBounds();
      //  Go through each...
      $.each(markers, function (index, marker) {
      bounds.extend(marker.position);
      });
      //  Fit these bounds to the map
      map.fitBounds(bounds);
    }
    AutoCenter();
 
 
   var infoWindow = new google.maps.InfoWindow({map: map});
 if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {
       var pos = {
        lat: position.coords.latitude,
        lng: position.coords.longitude
      };

      infoWindow.setPosition(pos);
      infoWindow.setContent('You');
      map.setCenter(pos);
        
        
           for (i = 0; i < locations.length; i++) {  
         
            if(position.coords.lat-locations[i][3]>.0002){
             if(position.coords.long-locations[i][4]>.0002){
             alert("Found it");
             }
            }
            
        }
            
        
    
    }, function() {
      handleLocationError(true, infoWindow, map.getCenter());
    });
  } else {
    // Browser doesn't support Geolocation
    handleLocationError(false, infoWindow, map.getCenter());
  }

 
      map.setZoom(3);

 
    </script>
    
    
    
    <script>
var mySpreadsheet='https://docs.google.com/spreadsheets/d/YOUR PUBLIC SPREADSHEET URL';
 $('#statistics').sheetrock({
  url: mySpreadsheet
});
    
    </script>
</body>
</html>


Which gives us:




evelIN

Lets get posting again, alot of what I have been up to lately has been for profit projects and stuff I can't reveal yet but anyway:


Chrome based app using speech for the deaf, allow communication to a deaf person by speaking and the app produces large text, handled scrolling through css and clearing through timeouts:

Before:

Once Started:

Saturday, September 5, 2015

Audio Jack PWM

Needed a goodway to do pwm from the computer directly, went with the audio jack as the source. Pretty simple script and GUI but this damn bog is just a showcase in case for some reason I need to demonstrate whatever.




 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PWMjack
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Go_Click(object sender, EventArgs e)
        {
            
            wavetime.Interval = Int32.Parse(avlue.Text);
            wavetime.Enabled = true;
        }
        private void wavetime_Tick(object sender, EventArgs e)
        {
            Console.Beep();
            wavetime.Interval = Int32.Parse(avlue.Text);
        }

        private void avlue_TextChanged(object sender, EventArgs e)
        {

        }

        private void track_Scroll(object sender, EventArgs e)
        {
            avlue.Text = track.Value.ToString();
            wavetime.Interval= Int32.Parse(avlue.Text);
        }
    }
    }

Friday, September 4, 2015

Phishbot: The Message: Part III

Okay, it is pretty easy from here. All we need to do now is inject some .NET into our solution to solve the issue of cross window communication( rather not edit all the JS right?).

My dorm neighbors are arguing over whether cardio or lifting makes you "more smarter"....


THe Cleverbot:

you can also get this straight from the C# but I don't give a flying.

Facebook is pretty simple we can measure where the mouse needs to be to click in the box and then we just type like a human with the .append() feature of C# or inject JS to do the same thing by installing a value into an active JS variable.

In C# (Mixing up the languages) we can write:
Coupled with a form like this:
which prints the current position of our cursor each time we press enter. Also for those Java fans out there:


MouseInfo.getPointerInfo().getLocation

and print it into a Jtextbox.

Now we simply need a form:

which navigates to the target and enters torrents of data to enter. The mouse can be maneuvered to the appropriate position like so:
for C# or:
for Java.

That ought to do it, I might fill in the details later for y'all but there is really no need. Happy fishing!

Thursday, September 3, 2015

PhishBot: The Message: Part II

McCormack here, signing in from a new IP. After being shipped off to college I have decided that in order to stay sane I will be working on many projects here as the "teachs" haven't yet given out busy work. Anyway from where we left off.


So we need a way to have JS message between two different windows, that way we can link a system like Cleverbot up to our Facebook Messaging Service for our Phishbot. There is such a way localStorage which ought to work here. Now we could run the whole system through Post and Pull requests but for right now we will wait and C(haha).

 To pull data from cleverbot is easy, we can identify the span or just hijack the share button for our nefarious purposes directly:


Okay, lets try hijacking first:

We need to get to this snipBox:


That is just a button click away or two, we just need to confirm that the button names are not dynamic like they are on fb, else we will have to switch our methodology as I demonstrated how to bypass dynamic web code in a previous post.

Trying directly from the console:

Success is undefined in a non philosophical way here because there isn't an ouput but that sure did open the first dialogue:

Finishing:


Okay and now we parse that data, but I have to go take a Spanish placement exam, so I'd rather make a new post after than continue this one.

Chao

Monday, August 24, 2015

PfishBot:Autophishing: The Request: Part I

So we will jump back to messaging in a minute but first we need to go here:

https://m.facebook.com/findfriends/browser/

Where we can "find friends".


Now the JS here is really simple whip open console and we can do a test before we loop it


Successful

And now we use the location.reload(), this will reset the suggestions:



 and now time to automate:

1
2
3
4
5
6
7
8
9
while(1){

document.querySelectorAll("button[type='submit']")[0].click();
  setTimeout(func, 3000);
  function func(){
location.reload();
}
  
}
It may be best to use a for loop though but it works. You actually need a significant delay apparently facebook thinks the public is rather slow. So put as long as you need, a minute so that they never try to block you might be a good idea.

PfishBot:Auto Phishing: Messaging: Part I

Phishing is the process of creating fake IDs and making them appear real. I decided to automate the whole process from replying to messages to adding "friends".

First thing to do is set up the messaging system as this is doubtless to be the most difficult part.

First we find a weakpoint in the site to launch from, in the case of Facebook the page with the most functionality and least html to scan and possibly parse is:


Now I should mention that in order to create a fake account you will probably need a phone number, and getting past this is just not worth it as free applications such as text+ work just fine. Or use a payphone. I don't care.

Great now finding the  message box name is easy:

"composerInput"

however the button for send is a bit more dynamic, it changes each time and there is a convoluted js and php script which hides it unless text was dynamically entered". Two ways past, JS or .Net.


JS

So the JS code is real simple:

Inspect the text box. Lets say for our example it is running under the ID of "u_0_5":


 The errors happened because of button ID change. Now we can text the click again, once we have entered text so as to fake the button(we will get to doing this automatically shortly):
So our code is:

1
2
3
4
5
6
7
8
var content = document.body.textContent || document.body.innerText;
var hasText = content.indexOf("Way to go")!==-1;
if(hasText){
   setTimeout(function(){
       document.getElementById('composerInput').value="Second Check";
    document.getElementById('u_3p_5').click();
   },5000);
}

But that really is not too useful because we have not been able to send it free of user interaction, due to that messy script(or set of scripts) we have left to tackle.

Sunday, August 9, 2015

Check site for User names

Well we all might want to programatically check a site for user names, quick demo post here, a kind I have not done in a while:

So for all you script kiddies out there here is what we end with:

window.location = 'http://www.facebook.com'
checkers();
function checkers()
{
  var user = '';
  var text = '';
  var possible = 'abcdefghijklmnopqrstuvwxyz';
  for (var i = 0; i < 6; i++)
  text += possible.charAt(Math.floor(Math.random() * possible.length));
  document.forms[0].elements[1].value = text + '@gmail.com';
  document.forms[0].elements[2].value = 'password';
  var pablo = document.forms[0].elements[3];
  pablo.click();
  if (document.all('content').innerHTML.indexOf('Please try again') >= 0)
  {
    user = user.concat(text + '@gmail.com')
    checkers();
  }
}
str.indexOf('Yes') >= 0

Now to run it:

A moder browser is all you really need. This post is really just a mod of the Bane JS Cracker I posted a while ago. Anyway just mess with the form elements depending on the site. Then you just need to save and parse string user however you choose. One could just C+V from a alert() window, and just change the infinite loop of this code to stop after a certain amount. Whatever your heart desires.

Quick old Digital Steg Pt 1

Finished the book so back to blogging again, heres a quick post:


To begin with we can just edit the straight up pixels, not unlike this:

size(200, 200);
loadPixels();  
for (int i = 0; i < pixels.length; i++) {
  float r= random(255);
  color c = color(r);
  pixels[i] = c;
}
updatePixels(); 

We just need to add an algorithm which encodes useful information, perhaps with less data(this image contains 250,000 bits. It might be best if we modify the pixels of an image, for better disguise than an old cctv when the lines are down. Here I'll whip up a quick example to get those started who are here for the first time:

PImage webImg;

void setup(){
size(500, 500);

  String url = "https://processing.org/img/processing-web.png";
  // Load image from a web server
  webImg = loadImage(url, "png");
}
void draw(){
  image(webImg, 0, 0);
loadPixels();  
for (int i = 0; i < 25000; i++) {
  float rand = random(255);
  color c = color(rand);
  pixels[i] = c;
}
updatePixels(); 
}

Of Course creating:
The best way to disguise our messages are clever manipulations of the alpha levels, but lets keep it in "acceptable areas" near the edges of lines, so we will first mess with random alphas for demonstration, then create a "smart" program to hide our messages even more effectively, and then we will make the encoder/decoder.
Okay, so just a random dash of message, or no particular meaning yet:
See? Very sloppy. It is rather obvious those 4 dots caused by:
PImage webImg;

void setup(){
size(500, 500);

  String url = "https://processing.org/img/processing-web.png";
  // Load image from a web server
  webImg = loadImage(url, "png");
}
void draw(){
  image(webImg, 0, 0);
loadPixels();  
for (int a = 0; a < 25; a++) {
  float i=random(pixels.length);
  float rand = random(255);
  color c = color(rand);
  pixels[(int)i] = c;
}
updatePixels(); 
}

So we must use line detection and start to make our message meaningful. Let us start with the latter method and make a simple coding schema:

CODING SCHEMA HERE

Now in addition we can also make messages through the combination of images which are meant to be deciphered by a human reader.The good old syllipsis program will also work just adding a contextualizer i.e. : "userenteredfilename"+".jpg"  based on user input, but lets import the Syllipsis.jar code to speed things up, why code that which you yourself have already written?:
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import processing.core.*; 
import processing.data.*; 
import processing.opengl.*; 

import javax.swing.JFileChooser; 

import java.applet.*; 
import java.awt.Dimension; 
import java.awt.Frame; 
import java.awt.event.MouseEvent; 
import java.awt.event.KeyEvent; 
import java.awt.event.FocusEvent; 
import java.awt.Image; 
import java.io.*; 
import java.net.*; 
import java.text.*; 
import java.util.*; 
import java.util.zip.*; 
import java.util.regex.*; 

public class htmlsaver extends PApplet {


String realtime;
String file;
String savers;
boolean btn= false;
String lastInput = new String();
String currentInput = new String();

public void setup()
{

  
   
  background(204);
 size(800, 600);
 smooth();
 


 textAlign(CENTER);
}

public void draw()

{
  
  if (btn == true) {
    fill(255);
  } else {
    noFill();
  }
  rect(20, 60, 75, 75);
  ellipse(60,90,50,50);
   
  fill(0);
text("Thanks for Using Syllipsi By Daniel McCormack",width/2,60);
 text(lastInput, width/2, height/2);
 fill(255, 255, 255);
 text(currentInput, width/2, height*.75f);
 
   


}
public void mousePressed(){
  if (btn){
    exit();
  }
}
public void keyPressed()
{
 if(key == ENTER)
 {
   lastInput = currentInput = currentInput + key;
   currentInput = "";
   lastInput="http://"+lastInput;
 
   
JFileChooser chooser = new JFileChooser();
int returnVal = chooser.showOpenDialog(null);


{
  println("Saving <HTML> to " + chooser.getSelectedFile().getName());
    file = chooser.getSelectedFile().getName();
   
String currline[] = loadStrings(lastInput);
for (int i = 0 ; i < currline.length; i++) {
  println(currline[i]);
saveStrings(file,currline);
}
}
 }
 else if(key == BACKSPACE && currentInput.length() > 0)
 {
   currentInput = currentInput.substring(0, currentInput.length() - 1);
 }
 else
 {
   currentInput = currentInput + key;
 }
}

public void mouseMoved() { 
  checkButtons(); //for our magical menu
}
  
public void mouseDragged() {
  checkButtons(); //again the gui menu check 
}

public void checkButtons() {
  if (mouseX > 20 && mouseX < 95 && mouseY > 60 && mouseY < 135) {
    btn = true;    //the final gui menu check
    

  } else {
    btn=false;
  }
}




  static public void main(String[] passedArgs) {
    String[] appletArgs = new String[] { "--full-screen", "--bgcolor=#666666", "--stop-color=#cccccc", "htmlsaver" };
    if (passedArgs != null) {
      PApplet.main(concat(appletArgs, passedArgs));
    } else {
      PApplet.main(appletArgs);
    }
  }
}
And we only need the new JFileChooser() at the end to save our new "image chain". 
and lets focus on this region:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
public void keyPressed()
{
 if(key == ENTER)
 {
   lastInput = currentInput = currentInput + key;
   currentInput = "";
   lastInput=lastInput+".jpg";//contextualizer
 }

 else if(key == BACKSPACE && currentInput.length() > 0)
 {
   currentInput = currentInput.substring(0, currentInput.length() - 1);
 }
 else
 {
   currentInput = currentInput + key; //input update
 }
}
Let's fix this up with a little bit of reorganizing. We dump the menu chooser in the exit area. The "[ENTER] adds the picture.
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import processing.core.*; 
import processing.data.*; 
import processing.opengl.*; 

import javax.swing.JFileChooser; 

import java.applet.*; 
import java.awt.Dimension; 
import java.awt.Frame; 
import java.awt.event.MouseEvent; 
import java.awt.event.KeyEvent; 
import java.awt.event.FocusEvent; 
import java.awt.Image; 
import java.io.*; 
import java.net.*; 
import java.text.*; 
import java.util.*; 
import java.util.zip.*; 
import java.util.regex.*; 

public class htmlsaver extends PApplet {

PImage img;
    
String realtime;
String file;
String savers;
boolean btn= false;
String lastInput = new String();
String currentInput = new String();

public void setup()
{

   

  background(204);
 size(800, 600);
 smooth();
 


 textAlign(CENTER);
}

public void draw()

{
  
  if (btn == true) {
    fill(255);
  } else {
    noFill();
  }
  rect(20, 60, 75, 75);
  ellipse(60,90,50,50);
   
  fill(0);
text("Thanks for Using pixtitch By XOS",width/2,60);
 text(lastInput, width/2, height/2);
 fill(255, 255, 255);
 text(currentInput, width/2, height*.75f);
    
       

String currline[] = loadStrings(lastInput);
for (int i = 0 ; i < currline.length; i++) {
  println(currline[i]);
saveStrings(file,currline);

}
 }
 else if(key == BACKSPACE && currentInput.length() > 0)
 {
   currentInput = currentInput.substring(0, currentInput.length() - 1);
 }
 else
 {
   currentInput = currentInput + key; //input update
 }
}


}
public void mousePressed(){
  if (btn){
    JFileChooser chooser = new JFileChooser(); //prompt a save if the "game" is over
int returnVal = chooser.showOpenDialog(null);


{
  println("Saving pixtitch to " + chooser.getSelectedFile().getName());
    file = chooser.getSelectedFile().getName();
}
  }
}
public void keyPressed()
{
 if(key == ENTER)
 {
   lastInput = currentInput = currentInput + key;
   currentInput = "";
   lastInput=lastInput+".jpg";//contextualizer
   img = loadImage(lastInput);
   image(img, 0, 0); 
 }
}
 


public void mouseMoved() { 
  checkButtons(); //for our magical menu
}
  
public void mouseDragged() {
  checkButtons(); //again the gui menu check 
}

public void checkButtons() {
  if (mouseX > 20 && mouseX < 95 && mouseY > 60 && mouseY < 135) {
    btn = true;    //the final gui menu check
    

  } else {
    btn=false;
  }
}




  static public void main(String[] passedArgs) {
    String[] appletArgs = new String[] { "--full-screen", "--bgcolor=#666666", "--stop-color=#cccccc", "htmlsaver" };
    if (passedArgs != null) {
      PApplet.main(concat(appletArgs, passedArgs));
    } else {
      PApplet.main(appletArgs);
    }
  }
}
And now focus on this:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
public void keyPressed()
{
 if(key == ENTER)
 {
   lastInput = currentInput = currentInput + key;
   currentInput = "";
   lastInput=lastInput+".jpg";//contextualizer
   img = loadImage(lastInput);
   int x=img.width
   int a=a+25
   image(img, a, 0,25,25);
 }
}
And now to wrap things up:
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import processing.core.*; 
import processing.data.*; 
import processing.opengl.*; 

import javax.swing.JFileChooser; 

import java.applet.*; 
import java.awt.Dimension; 
import java.awt.Frame; 
import java.awt.event.MouseEvent; 
import java.awt.event.KeyEvent; 
import java.awt.event.FocusEvent; 
import java.awt.Image; 
import java.io.*; 
import java.net.*; 
import java.text.*; 
import java.util.*; 
import java.util.zip.*; 
import java.util.regex.*; 

public class htmlsaver extends PApplet {

PImage img;
    
String realtime;
String file;
String savers;
boolean btn= false;
String lastInput = new String();
String currentInput = new String();

public void setup()
{
int a=0;
   

  background(204);
 size(800, 600);
 smooth();
 


 textAlign(CENTER);
}

public void draw()

{
  
  if (btn == true) {
    fill(255);
  } else {
    noFill();
  }
  rect(20, 60, 75, 75);
  ellipse(60,90,50,50);
   
  fill(0);
text("Thanks for Using pixtitch By XOS",width/2,60);
 text(lastInput, width/2, height/2);
 fill(255, 255, 255);
 text(currentInput, width/2, height*.75f);
    
       

String currline[] = loadStrings(lastInput);
for (int i = 0 ; i < currline.length; i++) {
  println(currline[i]);
saveStrings(file,currline);

}
 }
 else if(key == BACKSPACE && currentInput.length() > 0)
 {
   currentInput = currentInput.substring(0, currentInput.length() - 1);
 }
 else
 {
   currentInput = currentInput + key; //input update
 }
}


}
public void mousePressed(){
  if (btn){
    JFileChooser chooser = new JFileChooser(); //prompt a save if the "game" is over
int returnVal = chooser.showOpenDialog(null);


{
  println("Saving pixtitch to " + chooser.getSelectedFile().getName());
    file = chooser.getSelectedFile().getName();
}
  }
}
public void keyPressed()
{
 if(key == ENTER)
 {
   lastInput = currentInput = currentInput + key;
   currentInput = "";
   lastInput=lastInput+".jpg";//contextualizer
   img = loadImage(lastInput);
   int x=img.width
   int a=a+25
   image(img, a, 0,25,25);
 }
}
 


public void mouseMoved() { 
  checkButtons(); //for our magical menu
}
  
public void mouseDragged() {
  checkButtons(); //again the gui menu check 
}

public void checkButtons() {
  if (mouseX > 20 && mouseX < 95 && mouseY > 60 && mouseY < 135) {
    btn = true;    //the final gui menu check
    

  } else {
    btn=false;
  }
}




  static public void main(String[] passedArgs) {
    String[] appletArgs = new String[] { "--full-screen", "--bgcolor=#666666", "--stop-color=#cccccc", "htmlsaver" };
    if (passedArgs != null) {
      PApplet.main(concat(appletArgs, passedArgs));
    } else {
      PApplet.main(appletArgs);
    }
  }
}