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 - Atomic

Pages: [1] 2
1
Drivers / FluffOS on (Synology) NAS
« on: July 23, 2013, 06:12:45 AM »
Question for the FluffOS experts: do you think it's feasible to get FluffOS to compile on a Linux-based NAS system? In my case a Synology brand.

2
Shoot me if this is noobish, but I want to find out.
In this piece of code from Leo.c a player who solves a quest is rewarded with exp and coins.
Code: [Select]
int CompleteQuest(object ob){
    string *quests;
    quests = ob->GetQuests();
    if(!ob->GetQuest("Orc Slayer Quest")){
        ob->AddQuest("the Orc Slayer","Orc Slayer Quest");
        eventForce("say You have solved the Orc Slayer Quest. Congratulations!");
        eventForce("say I hereby award you 10 quest points, and 2000 experience points!");
        ob->AddQuestPoints(10);
        ob->AddExperiencePoints(2000);
              ob->CompleteQuest("the Orc Slayer", "Orc Slayer Quest");
        reload("/domains/town/room/valley",0,1);
        reload("/domains/town/room/orc_fortress",0,1);
        reload("/domains/town/room/orc_temple",0,1);
    }
    return 1;

Now say I want this solver to receive an item besides his money and exp, how would I do that? I'm not quite figuring out the command.  ???
Right after 'ob->AddExperiencePoints(2000); I figure there must be something like:
'ob->AddObject(this_player, /path-to-item)'.

Does anyone have a really simple example or a reference in the default lib?
Eventually I'd like to program NPC's to return parts of items as part of the quest.
So upon saying or giving something to NPC 'A' a player would receive an item which is necessary to receive the next
piece from NPC 'B', which can be taken to NPC 'C' and so on...

Help's appreciated!

3
Open Chat / Merry Christmas and a happy New Year!
« on: December 25, 2007, 10:46:02 AM »
For my fellow lpmuds members as well as for those who just happen to stumble across:

I wish you a merry Christmas (in The Netherlands we actually have 1st and 2nd Christmas day... go figure)
and a happy 2008. Careful with the fireworks... coding lpc is harder with less fingers...  ;D

4
Dead Souls Support / I compile MudOS on...
« on: May 24, 2007, 07:24:03 AM »
Just to get a clear view on what systems you guys are using and what development tools/libraries/compilers
are needed to do so, I'd like to know on what OS you're running your version of MudOS.

I've tried on RedHat about 5 years ago, presently I've tried:

Debian Linux 3.0
Debian Linux 3.1
Debian Linux 4.0 (where it runs on now)

I'm feeling that I could compile my MudOS driver probably a lot better if only I knew how.
Perhaps I'm still missing something.

5
Dead Souls Support / Setting up DS2.x - C-compiler not found
« on: May 20, 2007, 03:58:37 PM »
I've a freshly installed Debian 4.0 (Etch) server here, but upon the very first
./configure the script doesn't seem to be able to find a couple of things,
although I have them installed using apt-get install gcc-2.95 (and 4.0).

Here's the output:
Code: [Select]
MeanMachine:/ds2.4.2/v22.2b14-dsouls2# ./configure
Preparing to build developmental version of MudOS driver ...
Trying out some stuff to see what works; ignore errors ...
./build.MudOS: line 145: gmake: command not found
make: Nothing to be done for `nothing'.
./build.MudOS: line 184: xlc: command not found
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
./build.MudOS: line 200: clcc: command not found
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
FATAL ERROR: Cannot find a C compiler
No Wolfpaw config needed.
MeanMachine:/ds2.4.2/v22.2b14-dsouls2#

What do I miss?

Code: [Select]
MeanMachine:/ds2.4.2/v22.2b14-dsouls2# apt-get install gmake
Reading package lists... Done
Building dependency tree... Done
E: Couldn't find package gmake
MeanMachine:/ds2.4.2/v22.2b14-dsouls2# apt-cache search gmake
cfgstoragemaker - MRTG config generator for storage monitoring via SNMP
MeanMachine:/ds2.4.2/v22.2b14-dsouls2#
  ???

6
Dead Souls Support / Items that modify/add to combat
« on: April 10, 2007, 03:19:53 AM »
Is there perhaps an example available (on your mud on DS2.x stock) of items that are carried
or worn by players that help within combat?

I'd optionally like to see, say, a magical cloak that helps attacking the person that you've
started attacking.
In this light the item should display combatmessages, reporting on hitpointloss/damage/general taunting.
The items (be it worn, wielded or even in inventory), could have hitpoints of their own.
In a broader application I could see this type of behavior set to mounts for instance.
Say, warhorses that aid in combat...

If it's in the game already could you point me to it, otherwise if anyone's mud could show me
on my way with some examples, that'd be most wonderful.

7
Dead Souls Support / Defaultroom for players
« on: March 22, 2007, 10:11:53 AM »
I've been searching around the lib, but couldn't find whether it is possible
to make the room in which a player enters the mud is player-definable.

I would like to be able to always make Rangers pop-up in the forest (guildhall),
Fighters in their barracks, etc.

So the spawnroom would have to be a property of the player itself.

/edit: now I'm thinking of it, I don't know what current playerbehavior is when loggin on/off, I'll go check that
as soon as I'm at home again.



8
Dead Souls Support / *nix command 'ls' not working upon first logon
« on: March 07, 2007, 04:23:09 PM »
Thought I already mentioned this before, but just to be sure I'll do it again.
It seems as upon the first logon the unix/linux command 'ls' (and parameters -sla)
don't work.

They work as soon as the wizard (or administrator) has first initiated the
workroom-space.

See log below for what happened:
Code: [Select]
/realms/atomic/workroom
Atomic's workroom [e, d]
You are standing in the workroom of the mighty Atomic! 
You may return to the Creators' Hall by going down.
A sample room is east.
There is a sign here you can read.
There is a sheet here you can read.
A wooden chest and a recycling bin are here.

> ls

No current working directory.
> ls -sla

---
2007.03.07-20.56
*Value being indexed is zero.
Object: /secure/save/creators/a/atomic (/lib/files.c) at line 18

'<function>' at /secure/save/creators/a/atomic (<function>) at /:0
'cmdAll' at /secure/save/creators/a/atomic (/lib/command.c) at line 129
'cmd' at /secure/cmds/creators/ls at line 48
'wild_card' at /secure/save/creators/a/atomic (/lib/files.c) at line 18
Trace written to /log/runtime
home
You twitch.
> ls

No current working directory.
> home

You twitch.
> l

/realms/atomic/workroom
Atomic's workroom [e, d]
You are standing in the workroom of the mighty Atomic! 
You may return to the Creators' Hall by going down.
A sample room is east.
There is a sign here you can read.
There is a sheet here you can read.
A wooden chest and a recycling bin are here.


> save

Atomic is now saved.
> ls

No current working directory.
> cd

/realms/atomic:
> ls

/realms/atomic/:
     adm/                cmds/               tmp/           
     area/           1   customdefs.h    003 workroom.bak   
     bak/                log/           *003 workroom.c     


> ls -sla

/realms/atomic/:
   rw-  Wed Mar  7 20:56:01 2007       28       .plan
   rw-  Wed Mar  7 20:56:01 2007       21       .profile
   rw-  Wed Mar  7 20:56:01 2007       -2       adm/
   rw-  Wed Mar  7 20:56:01 2007       -2       area/
   rw-  Wed Mar  7 20:56:01 2007       -2       bak/
   rw-  Wed Mar  7 20:56:01 2007       -2       cmds/
   rw-  Wed Mar  7 20:56:01 2007       362      customdefs.h
   rw-  Wed Mar  7 20:56:01 2007       -2       log/
   rw-  Wed Mar  7 20:56:01 2007       -2       tmp/
   rw-  Wed Mar  7 20:56:01 2007       3087     workroom.bak
*  rw-  Wed Mar  7 20:56:01 2007       3087     workroom.c


>

Only seems to work correctly as expected after the first cd command.
 ???

9
Dead Souls Support / Liveupgrade
« on: March 07, 2007, 09:21:20 AM »
As a small side-note, yesterday evening I did exactly what is typed below:
Code: [Select]
arch
go down
go south
cd /secure/upgrades/txt
rm list.txt
cd /secure/upgrades/files
liveupgrade all Dead Souls  (give it a minute for the new list to download, then do it again. If you get a token error, just keep trying.)
liveupgrade all Dead Souls (wait for all the stuff to finish scrolling by)
ls (to see if there are files downloaded)
liveupgrade apply
shutdown now

I had to type 'liveupgrade all Dead Souls' about 3x times, because it
stopped (token error?).
Didn't even got to the 'ls'/'liveupgrade apply'-part, because single lines of *.c-files just kept scrolling by.  :P
Fell asleep after my mudclient's bufferlog lost count ...which is a good thing I guess, lots of stuff to upgrade.

Is it necessary to display every single line, in stead of just upgrading the entire *.c-file?
Not meaning to be rude or anything, and if I'm missing a point you could also safely blame me.

Upgrading from 2.3.a5 to the latest (btw, is there a way to see to what version you're actually upgrading?)
... can't wait to get home and see how things turned out...

10
Dead Souls Support / Sockets / web-access to mud
« on: February 16, 2007, 08:34:47 AM »
Of course, non-intelligent as I am, I haven't found anything yet to communicate with my
mud from outside the mud-environment.

Optionally I'd like to retrieve info from my mud like

- fingerplans
- status of the mud (uptime, reboot, etc.)
- any form of tracking (kills, deaths, toplists of players/cash/stats)

Where (what files) should I start my quests for the sockets?
Any examples of 'external' mudcommunications are most welcome.

11
Dead Souls Support / Combathistory, remembering attacks
« on: February 16, 2007, 04:18:26 AM »
Does DS2 support any form of combat remembrance?  ???
I'd like to make it so that entering/leaving rooms could trigger combat,

based upon:

- previous combat
- alignment (could be done by editing npc's script, checking for alignment, if blah then attack)
- stopping combat (either by spell or command), leaving room, npc remembers you and starts again,
  even if alignments are found to be good and npc is not auto-aggressive).

12
Bug Central / Picture not displaying top right
« on: December 08, 2006, 08:50:57 AM »
Top-right corner op every forum screen is supposed to
be an image I guess, but it displays a nice white
square with a beautiful red cross in the middle with me.  ;D

13
Open Chat / Therapy/Support
« on: September 20, 2006, 11:18:02 AM »

Hi Folks,



So, how many of you are going crazy from failed attempts at coding? I know I am. So far, I've managed to cause a syntax error on a non-existant line, corrupt my .o file at least once, crash my mud multiple times, and scream obscenities at anyone who'll listen.



Anyone else wanna share? ;)


14
Promotions / LP Heroes
« on: September 14, 2006, 10:14:11 AM »


Hello all,



My name is Tigwyk, and I'm running LP Heroes, a superhero themed mud running DS2.1. Currently we're in very early initial stages of creation, mostly working on reworking the lib a bit, adding features I feel are lacking, and figuring out what sort of areas, skills, and classes will be available.



I've got some ideas lined up, a couple coders (but I don't consider them permanent because they have lives and they're only on-board because it's an interesting idea), and lots of enthusiasm.



I guess I'm hiring, since I do need more people. LPC experience is preferred, but not required. I'm teaching two LPC newbies to code so I've obviously got patience. ;)



There are almost no new areas yet, but we're working on that. We plan on having a bunch of different cities, starting with New York. I've done some lib work, and I'm working on getting a skilltree in place for the skill system I'd like to implement.



Please feel free to stop by and check it out, just make note that it won't look very different from a stock DeadSouls mud because the areas aren't ready yet.



Addy: 208.101.6.202

Port: 6666



On LP Heroes, you can aspire to be the greatest superhero or supervillain the world will ever know! But beware, everyone has their weakness...


15
Code Vault / Really EASY Socket Code (simple_sockets.c)
« on: October 12, 2006, 12:13:00 PM »
Mudlib: DeadSouls 2.1 on Windows Server 2003

Driver: MudOS v22.2b14

Filename: simple_sockets.c



Hi folks,



I was recently required to roll my own inheritable socket object with minor error checking, etc. I couldn't really put the other socket objects to good use, so I figured making my own would do two things: 1) Teach me sockets, 2) Fix my problem, because it would be my code and I'd know how it works.



Well, I got it working. Place the file in /secure/lib/net/ if you want it to work properly (or anywhere in secure, really) because of the way security behaves. I believe the item that inherits this code ALSO has to be in a secure directory, but I haven't tested that yet.



LPC code:

/*  _____________________________
 * /                             \
 * |                             |
 * |   Simple Sockets by         |
 * |   Tigwyk @ LP Heroes       |
 * |              10/11/06       |
 * |                             |
 * \_____________________________/
 */

#include <lib.h>
#include <network.h>
#include <socket_err.h>

inherit LIB_ITEM;

// Prototype the functions, just because things tend to complain otherwise.

mixed socketConnect(string ip, int port);
void read_callback( int fd, mixed message );
void write_callback( int fd );
void close_callback( int fd );
mixed socketClose();

// Global variables, cuz those are always nice.

int attempting, connected, socket ;
object player;

// Create() is really only used to set up the item basics and make sure the
// variables contain proper data (even if it's a 0 right now).

static void create() {
      ::create();
      attempting = 0 ;
    connected = 0 ;
    socket = 0 ;
  }

// socketConnect() is used to connect to an IP and port using STREAM.
// STREAM is the basic type of TCP connection, and can be used for all sorts of stuff.
// We also check for errors here because it's nice to know when a socket error occurs.

mixed socketConnect(string ip, int port){
int new_socket, sc_result;
string error;

new_socket = socket_create( STREAM, "read_callback", "close_callback" ) ;

if( new_socket < 0 )
    {
   switch( new_socket )
   {
   case EEMODENOTSUPP :
       error = "Socket mode not supported.\n" ;
       break ;
   case EESOCKET :
       error = "Problem creating socket.\n" ;
       break ;
   case EESETSOCKOPT :
       error = "Problem with setsockopt.\n" ;
       break ;
   case EENONBLOCK :
       error = "Problem with setting non-blocking mode.\n" ;
       break ;
   case EENOSOCKS :
       error = "No more available efun sockets.\n" ;
       break ;
   case EESECURITY :
       error = "Security violation attempted.\n" ;
       break ;
   default :
       error = "Unknown error code: " + new_socket + ".\n" ;
       break ;
   }
   return "Unable to connect, problem with socket_create.\n"
     "Reason: " + error;
    }
    sc_result = socket_connect( new_socket, ip + " " + port, "read_callback", "write_callback" ) ;
    if( sc_result != EESUCCESS ) {
      return "Failed to connect.";
    }
    attempting = 1 ;
    socket = new_socket ;
    player=this_player();
    return 1;
}

// read_callback : This function is called when data is received from the socket connection.
// I have it piping the data directly to the player, you may want to change this to format it nicely.

void read_callback( int fd, mixed message )
{
   tell_object(player, message);
}

// write_callback : Not sure, but it's used for something with the socket connection. I ripped it from the telnet_client.c

void write_callback( int fd )
{
    write("Connected...\n");
    attempting = 0 ;
    connected = 1 ;
}

// close_callback : Called when the connection dies unexpectedly.

void close_callback( int fd )
{
    if( connected ) {
   write("Connection closed by foreign host.\n");
    }
    if( attempting ) {      
   write("Attempt failed.\n");
    }
    socket_close( fd ) ;
    attempting = 0 ;
    connected = 0 ;
    socket = 0 ;
}

// socketSend : Used to send data along the socket connection.
// Call this function when you want to send something to the connection.

mixed socketSend(mixed data){
      if(socket_write( socket, data + "\n" )) {
      return 1;
      } else { return "Failed to send data."; }
   }
      
// socketClose : Used to kill the socket connection properly.
// Call this to close your connection when you're done using it.      
      
mixed socketClose(){
   if(socket_close( socket )) {
   attempting = 0;
   connected = 0;
   socket = 0 ;
   return 1;
   } else { return "Failed to close socket."; }
}




I've commented it as nicely as possible. It was fun to make, too. I'll attach the dictionary (webster.c) in a new thread, and it makes use of my socket code so keep that in mind.



What I will also include here is an internet-savvy baseball. All it does is make use of my socket code to connect to my mud on the proper port and display the login screen. It's just a good test of the sockets.



LPC code:

#include <lib.h>
#include <network.h>
#include <socket_err.h>

inherit LIB_ITEM;
// Inherit the simple_sockets code for socket functionality.
inherit "/secure/lib/net/simple_sockets";

static void create() {
    ::create();
    SetKeyName("baseball");
    SetId( ({ "baseball", "ball" }) );
    SetShort("a baseball");
    SetLong("It's a real Spalding baseball!");
    SetMass(5);
    SetBaseCost(1);
}
void init(){
::init();
   add_action("throw_ball", "throw");
   // I made the add_action REALLY simple, it's just called "internet"
   add_action("internet", "internet");
}

int throw_ball(string str){
   if(!str || !id(str)){
      write("Throw what? The baseball?");
      return 1;
   }
   write("You throw the baseball at the wall.\nYou walk over and pick up the baseball from where it dropped.");
   say(this_player()->GetName()+" throws a baseball at the wall!\n"+this_player()->GetName()+" walks over and picks up the ball from where it dropped.");
   return 1;
}

// The function below connects to my mud's IP address and port using the socket code
// that I put into my inheritable object. It then sends a line of text across the connection,
// just to see if that works too.

int internet(string str){
   if(str) {
      write("Don't use an argument, dumbass.");
      return 1;
   }
   write(::socketConnect("208.101.6.202", 6666));
   if(::socketSend("MOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!")) {
      write("Sent testing text.");
   } else { write("Failed to send test text. :("); }
   return 1;
}





Voila, the magic internet-savvy baseball.



Anyhow, I hope you can all make use of this socket code. Please PLEASE leave feedback if you want to make it better. I want to learn this stuff better so let me know of any improvements or flaws in my code. I realize the error checking is minimal, but I'll improve that once I know how.



Cheers,

Tigwyk

Pages: [1] 2