Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - IbanX

Pages: [1] 2
1
Modification Help / A Guide to Document Altering
« on: October 27, 2007, 08:46:23 PM »
This guide will show you how to set up functions that will read and write on Documents. It is very helpful for keeping a permanent memorabilia of events. These can be automatic or manual. I will show you both.
Lets get started. I will show you the basic principals of reading and writing.

To keep things organized, create a folder called "manipulate"

Make a new document inside that folder and call it: script_stickynote.cs
Open it up and type this in:
Code: [Select]
function ServerCmdDocRead(%client, %doc)
{
%file = new FileObject(); // This makes %file a File-Type Variable

if(!isFile("Add-Ons/manipulate/" @ %doc @ ".txt")) { messageClient(%client,"","This file does not exist."); return;} // Without this Test-For-Existence code, an invalid file name would spell crash.

%file.openforRead("Add-Ons/manipulate/" @ %doc @ ".txt"); // Sets the value of %file
while(!%file.isEOF()) // Will loop through every line of the file until 'End of File'
{
%line = %file.readLine(); //%line = the current line
  messageClient(%client,"","\c2" @ %line); //Tells the client the line
}
messageClient(%client,"","\c6End of File"); //Tells the client the document has been ended
%file.close(); //Closes the document
%file.delete(); //Deletes the *VARIABLE*
}

Save and, in the same folder, make a document. Call it whatever you want, but make sure it's extention is  .txt. Put inside the document we just made this:

Quote
Good Job!
Much success!

Save and open up blockland. Make sure script_stickynote.cs is checked.

Type this in: /docread *NAME OF THE DOC YOU JUST MADE and press enter. You should get this:

Quote
Good Job!
Much success!

End Of Document



That's the basics of a document read. Now it's time to write.

Add this to your stickynote.cs:

Code: [Select]
function ServerCmdDocWrite(%client, %doc, %write)
{
%write = strreplace(%write, "SPC", " "); // Replaces the word 'SPC' with a space. Cheap ass way of avoiding the 50 variable method.

%file = new FileObject();

if(!isFile("Add-Ons/manipulate/" @ %doc @ ".txt")) { messageClient(%client,"","This file does not exist."); return;}

%file.openforWrite("Add-Ons/manipulate/" @ %doc @ ".txt"); // Opens the Document for Writing
%file.writeline(%write); // Writes the Line

messageClient(%client, "", "\c2The file was written upon."); //Alerts client that the file has been written to

%file.close();
%file.delete();
}

Now save, execute the file, and type: /docwrite *NAME OF THE DOCUMENT* HelloSPCMySPCGoodSPCFriend!

You'll get this:
Quote
The File was written Upon

Type
/docread *NAME OF THE DOCUMENT*

And you should get this:
Quote
Hello My Good Friend
End Of Document

More to come.

2
Drama / Vote on the loveuality of Aviv
« on: October 26, 2007, 09:52:44 PM »
READ:

Quote from: ENCYCLOPEDIA DRAMATICA
cigarette can refer to:

   1. Emos
   2. Anyone 0n not4chan
   3. AIDS victims
   4. A bundle of sticks
   5. A cigarette, in some cultures
   6. Anyone who gets pwn'd or recieves a 1up mushroom.
   7. A kind of meatball [1]
   8. A regular on the ED IRC# Dani Faulk
   9. Persons born on the last thursday before last.
  10. theredskull
  11. Bigbadron
  12. A Maggot
  13. Chris Crocker (more like Chris roosterer, amirite?)
  14. Your mom
  15. Hinder
  16. Confession
  17. Anyone with a myspace
  18. Bret Michaels
  19. Anyone with a LG
  20. Anyone
  21. G00ns
  22. Ewoks
  23. Jesse Harrison
  24. Dr. Firecrotch
  25. Disaster MB
  26. Juggalos
  27. George W. Bush
  28. Elton John
  29. Stickkam users
  30. you
  31. High school Drama whores
  32. Australians
  33. ANNOYING loving KIDS ON XBOX LIVE WHO SAY NOOB NEWB.
  34. Anyone who plays runescape. period.

3
Drama / Trader.
« on: September 18, 2007, 10:19:42 PM »
I give you the reason why I am not nice to people on my server who are on the edge of pissing me off. When I try to be nice, bad things happen.

4
Drama / I think I want to kill my mom.
« on: September 18, 2007, 02:26:12 PM »
Let me give you a run down about her. She is a slut who had me at 18. She is the sole reason I'm pro-choice. I'm hoping more whores that got knocked up at her age and would become stuffty parents would abort their kids as opposed to bringing them up miserably. She is 33 or something now and is single, haven't having her pusillanimous individual raided in the last 8 years. Of course, know that the last of her eggs are being destroyed by the body she's constantly in an angry state. She reminds me constantly about how pathetic I am about about how I suck the last loving slivers of joy out of her mind and how horribly unproud she is that I fell from her womb.

I want to kill this lady. Since she has no love in her life, besides possibly her own parents, and I would rather sit on this computer I am on now for the rest of my life than spend one more loving day with her, she has cats to add some bonding to her spirit. She speaks to these two cats like she would a room mate. Asking them how they were, how their days have been, and if they're hungry constantly. God forbid one of them meows back in response; thus ushering in an hour of goo-goo'ing while I mutter at her uselessness from the other room.

If my computer could pay the bills, I'd kill my mom.

5
Modification Help / Testing for a file
« on: September 17, 2007, 07:27:43 PM »
In creating a script that will automatically save and load player information, I noticed that by just moving MrPickle's trigger scripts to OnClientEnter caused problems. Normally a variable would tell if a person has saved money and thus has a file. Due to the fact no-one is saving now, it simply crashes when an unregistered user attempts to get in. How do I test for a file?

6
Modification Help / Tool-Belt Settings
« on: September 17, 2007, 04:34:43 PM »
I need a run-down on how to manipulate tool belts. (E.G. where hammers and weapons are stored.)

7
Modification Help / Changing A player's Clothes
« on: September 16, 2007, 06:22:21 PM »
Say I want to recolor someone entirely, make them all pure white. What would I do?

8
Modification Help / Timers?
« on: September 16, 2007, 03:38:02 PM »
I need someone to give me a run-down of how timers work. I do not know where to start.

9
General Discussion / Tropical RPG needs your halp!
« on: September 16, 2007, 05:52:19 AM »
I saved over the town.

Woo.

Anyone got a backup?

(E.G. Bloodbath / Duckster? >.>)

10
Modification Help / Changing a player's name.
« on: September 16, 2007, 01:36:17 AM »
Say I want the name to be:

Quote
(SomeVar)<NAME>

which looks like, for instance:

Quote
(Blockheaded) Iban

How would I do this?

11
Modification Help / Bounty Problems
« on: September 15, 2007, 09:56:35 PM »
My thought here is that:
If victim has a bounty, killer gets the bounty money.
If victim does not have a bounty, killer gets +$50 bounty + $10
If victim has a bounty and Self Deletes, people get alerted.
If victim Self Deletes, nothing special happens.

EVERYTHING works. Almost. For some reason, it doesn't detect Self Deletes. Also, it doesn't give the death icons.

Any ideas?

Code: [Select]
package deathtest{
function GameConnection::onDeath(%this, %sourceObject, %sourceClient, %damageType, %damLoc){

//Check for Self Delete
if((%this == %sourceClient) && (%this.bounty > 0)){
messageAll("",%this.name @ " coulden't take the pressure and ended the chase himself!");
}
else if(%this == %sourceClient)
{
}
else if(%this.bounty > 0)
{
%trans = %this.bounty;
messageAll("","\c2" @ %sourceClient.name @ "\c6 killed \c0" @ %this.name @ "\c6 and collected \c0$" @ %trans @ "\c6!");
%sourceClient.cash += %trans;
}
else
{
%sourceClient.bounty += 50;
messageAll("","\c0" @ %sourceclient.name @ "\c6 now has a \c0$" @ %sourceclient.bounty @ "\c6 bounty on him for killing \c2" @ %this.name @ "\c0");
messageClient(%sourceClient.name,"","\c6You looted \c0$10\c6 off \c3" @ this.name @ "\c6's corpse.");
%sourceClient.cash += 10;
}

Parent::onDeath(%this, %sourceObject, %sourceClient, %damageType, %damLoc);
}
};
activatepackage(deathtest);

12
Drama / You're all stupid dumbasses.
« on: September 11, 2007, 02:26:53 PM »


No love for Bushido.

13
Gallery / Badspot's Birthday Party!
« on: September 09, 2007, 10:26:47 PM »
I DO NOT CLAIM RESPONSIBILITY OF ANY OF THIS.
THIS WAS A COMMUNITY PROJECT DEDICATED TO BALDSPOT AND HIS BIRTHDAY.
MUCH LURVING WAS DONE ON THAT CAKE BEFORE I ATE IT ALL. I LOVED THE ICING, BY THE WAY.


BLOXEL:


REAL:

14
Modification Help / Coding Help - Everything is brokez.
« on: September 08, 2007, 09:26:12 PM »
Code: [Select]
function ServerCmdSelf Delete(%client)
{
if($Self Delete == 0) // Off
{
return;
}
else
{
parent::ServerCmdSelf Delete(%client);
}
}

What is wrong with my logic here?
EDIT: Self Delete will become disabled, but then wont allow you to kill yourself even if it is enabled.



Also, if you could give the name and directory of the main script (Like in Vanilla, all the main commands where stored in directory/scripts/sever/scripts/main.cs or something like that).

Thanks.

15
Modification Help / [REQUEST] Automated Gun Sales
« on: September 06, 2007, 08:10:37 PM »
Nothing much more to add.

Free loveual acts and  :cookie: to the code mongering whore who leaks the script.

Pages: [1] 2