Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

SPAM poetry

Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
12-21-2006 00:03
Have you ever read those randomly generated SPAM e-mails and saw some kind of psychotic poetry form? well, In a drunken stupor I've created a script that (with the forbidden open channel 0 listener) creates those random generated text blocks from SL chat :) This was created as an exercise for myself in manipulating strings and dealing with the memory limit which I've never hit until this project. Major thanks to the people in Scripting chat for pointing me along the way and allowing me to avoid using lists for manipulation. that being said, this code is in no way optimized and is for amusement/learning purposes only. feel free to improve upon it :)

here's an example of what you might find in your e-mail:

From: someone

There is you brag of an exclusive intimacy with them. Speak of the moderns without more, and, I promise you, that you will outgo all the people of your age
your buying at present, because it is not portable if you can borrow or This holds true, applied to manners which adorn whatever knowledge or letter is therefore very much shortened. Adieu.
I should not be surprised, if some of them were to propose, while we are informations. independent provinces in France, as the Duchy of Brittany, etc., whose purely, and unlarded with any other. Never seem wiser, nor more learned,
countenance. But it is low buffoonery, or silly accidents, that always pray answer me the following questions: to you, I will not let three posts go from hence without a letter from consequently worth inquiring into. There is hardly any body good for
for your curiosity and information, that is, the administration of you brag of an exclusive intimacy with them. Speak of the moderns without Can the Elector of Saxony put any of his subjects to death for high above it: They please the mind, and give a cheerfulness to the


and here's something that my script produced with some help from Scripting chat :):

From: someone

well, Okay, splitting them into separate scripts proves I was right, it's UTF-8. [23:54] Object: 100 ASCII = 107 bytes [23:54] Object: 100 Latin-1 = 208 bytes since it follows rotational impulse doesn't work on attachments it says... settorque does? llPointAt(vector pos) Makes the object owner's avatar point towards position pos. Use llStopPointAt to stop pointing. this is the broken one that should be doing what you want the All my tests come back as 2 bytes per character unless appended, then appending one leter to a blank space took 26 bytes same rule set as llApplyImpulse with attachments so movetotarget doesnt help turning, applyimpulse doesnt help turning, what else can there be?



here's the actual script(s)

CODE

string spam;


default
{
state_entry()
{
llListen(0,"",NULL_KEY,"");
}

listen(integer channel, string name, key id, string msg)
{
integer x;
string tester;

integer mem1=llGetFreeMemory();//since strings are truncated according to byte length, this block gets a strings size in bytes.
string test=spam + msg;
integer mem2=llGetFreeMemory();
integer strbyte=mem1 - mem2;

//llOwnerSay((string)strbyte);//Debugging shiz
test="";
if(strbyte <= 1023)//adds to the current string if it's going to be less than the max say length.
{
while(tester !=" " && spam !="")//picks a spot 'x' to insert our new sentence and makes sure that 'x' is a space.
{
x=llFloor(llFrand(llStringLength(msg)));
tester=llGetSubString(spam,x,x);
}
spam = llGetSubString(spam, 0, x) +" "+ msg+ " " + llGetSubString(spam, x, -1);
llOwnerSay(spam);
}
else//Since our next string addition exceeds the string length, dump off what we have and start over (more or less)
{
llSay(0,spam);
llEmail("myaddress@mydomain.com", "SPAM Poetry", spam);
spam=msg;
}

}

}
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
Ultralite Soleil
Registered User
Join date: 31 Aug 2006
Posts: 108
12-21-2006 15:57
Very creative!