Admin verbs - not the right term, but

1 view
Skip to first unread message

basil60

unread,
May 17, 2014, 2:08:09 AM5/17/14
to MOO-...@googlegroups.com
Hi
I'd like to be able to programme something like below, as a bog standard programmer.

Currently, line 6 returns an error, because (I assume) of permissions.

Is there a way (a work around), to be able to let programmers do this, without being admin?

Object:sword
swing this at any


if (iobj.location != player.location)
  player:tell("You must be in the same room to hit your opponent !");
else
  if (valid(iobj))
    player:tell("You hit ", iobj.name, " with your ", this.name, ".");
    iobj.health = iobj.health - 5;
    if (iobj.health < 0)
      player:tell("The demise of ", iobj.name, " is sad");
      return;
    endif
  endif
endif

Luke Dashjr

unread,
May 17, 2014, 2:17:56 AM5/17/14
to MOO-...@googlegroups.com, basil60
On Saturday, May 17, 2014 6:08:09 AM basil60 wrote:
> Hi
> I'd like to be able to programme something like below, as a bog standard
> programmer.
>
> Currently, line 6 returns an error, because (I assume) of permissions.
>
> Is there a way (a work around), to be able to let programmers do this,
> without being admin?
>
> ...
> iobj.health = iobj.health - 5;

Make a verb :set_health or :health_decrease or something. Any programmer can
call any verb, and the verb always runs with its programmer's permissions.

And be sure the property is not +c (IIRC).

basil60

unread,
May 17, 2014, 7:12:15 PM5/17/14
to MOO-...@googlegroups.com, basil60
I added set_health to #6 (generic player)

Code for that was:
player.health = player.health - 5;

with args of none none none and permissions of rxd.

I changed  iobj.health = iobj.health - 5; in my verb to #6:set_health();

No errors now when it runs, and it does almost as expected, but it doesn't affect players health.

Does it need to be corified? 

Seth I. Rich

unread,
May 17, 2014, 9:35:14 PM5/17/14
to basil60, moo-talk
What you probably want is for $player:set_health to be: this.health=args[1];
  (args[0] ? been a long time)
You probably also want some security check.

You'd also want to change its calling code to: iobj:set_health(iobj.health-5);
  (or something similar)

Look at your code: You're calling :set_health on $player instead of on any specific player, and you're setting the calling player's health instead of the health of the person he's attacking (?).

Seth
--
Seth I. Rich - se...@briar.com
Rabbits on walls, no problem.


--
You received this message because you are subscribed to the Google Groups "MOO Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to MOO-talk+u...@googlegroups.com.
To post to this group, send email to MOO-...@googlegroups.com.
Visit this group at http://groups.google.com/group/MOO-talk.
For more options, visit https://groups.google.com/d/optout.

Tim van Dijen

unread,
May 18, 2014, 4:52:30 AM5/18/14
to MOO-...@googlegroups.com
Also,  you want the args to be this-none-this, or you won't be able to call it!

- Tim

Seth I. Rich schreef op 18-5-2014 03:35:
Reply all
Reply to author
Forward
0 new messages