( AuctionClone.MUF v1.0 by Ginger@FurToonia ) ( ) ( Cloned by look not by code from Cirah@FurToonia's version & customised. ) ( ) ( @act check;credit;start bid;end bid;bid;give;status=here, ) ( @set here=_auction/creditsname:[def:'credits'] ) ( bid #help for help ) lvar arg : credit loc @ "_auction/auctioneer" getpropstr dup "" stringcmp 0 = if pop loc @ owner else atoi dbref then me @ dbcmp not if "You are not authorised to give out credit here." .tell exit then arg @ "=" explode 2 = not if "Too many arguments." .tell exit then part_pmatch dup #-1 dbcmp if pop pop "Give money to whom?" .tell exit then dup #-2 dbcmp if pop pop "Which one?" .tell exit then dup location loc @ dbcmp not if pop "Give it to who?" .tell exit then loc @ "_credits/" arg @ "=" explode pop swap pop part_pmatch intostr strcat getpropstr dup "" stringcmp 0 = if pop "0" then atoi arg @ "=" explode pop pop atoi + intostr loc @ swap "_credits/" arg @ "=" explode pop swap pop part_pmatch intostr strcat swap 1 addprop arg @ "=" explode pop pop loc @ "_auction/creditsname" getpropstr dup "" stringcmp 0 = if pop "credits" then " " swap strcat strcat " added to " strcat arg @ "=" explode pop swap pop part_pmatch name strcat "'s account." strcat .tell ; : getcredits loc @ "_auction/creditsname" getpropstr dup "" stringcmp 0 = if pop "credits" then ; : check_me loc @ "_credits/" me @ intostr strcat getpropstr dup "" stringcmp 0 = if pop "You have no account here." .tell exit then "You have " swap strcat " " strcat getcredits strcat "." strcat .tell ; : check loc @ "_auction/auctioneer" getpropstr dup "" stringcmp 0 = if pop loc @ owner else atoi dbref then me @ dbcmp not if check_me exit then arg @ " " instr 0 = not if "Too many arguments." .tell exit then arg @ dup "" stringcmp 0 = if pop me @ name dup arg ! else strip then part_pmatch dup #-1 dbcmp if pop "I don't see that here." .tell exit then dup #-2 dbcmp if pop "Which one?" .tell exit then dup location loc @ dbcmp not if name " is not here." strcat .tell exit then loc @ swap "_credits/" swap intostr strcat getpropstr dup "" stringcmp 0 = if arg @ strip part_pmatch name " has no account here." strcat .tell exit then arg @ strip part_pmatch name " has " strcat swap strcat " " strcat getcredits strcat "." strcat .tell exit ; : start_bid loc @ "_auction/auctioneer" getpropstr dup "" stringcmp 0 = if pop loc @ owner else atoi dbref then me @ dbcmp not if "Only the auctioneer can start the bidding." .tell exit then loc @ "_auction/auctioned" getpropstr dup "" stringcmp 0 = not if atoi dbref "You need to stop the bidding on " swap name strcat " first." strcat .tell exit then arg @ strip part_pmatch dup #-1 dbcmp if pop "Start bidding on whom?" .tell exit then dup #-2 dbcmp if pop "Bid on which one?" .tell exit then dup me @ dbcmp if pop "You can't start bidding on yourself." .tell exit then dup location loc @ dbcmp not if "Start bidding on whom?" .tell exit then dup loc @ swap "_auction/auctioned" swap intostr 1 addprop "Bidding started on " swap name strcat "." strcat .tell loc @ me @ " " notify_except me @ name " starts the bidding on " strcat arg @ strip part_pmatch name strcat "." strcat loc @ swap me @ swap notify_except loc @ me @ " " notify_except ; : end_bid loc @ "_auction/auctioneer" getpropstr dup "" stringcmp 0 = if pop loc @ owner else atoi dbref then me @ dbcmp not if "Only the auctioneer can end bidding." .tell exit then arg @ part_pmatch intostr loc @ "_auction/auctioned" getpropstr stringcmp 0 = not if arg @ part_pmatch name " is not currently up for bid." strcat .tell exit then loc @ "_auction/curbid" getpropstr dup "" stringcmp 0 = if pop "0" then atoi dup arg @ part_pmatch intostr loc @ swap "_credits/" swap strcat getpropstr dup "" stringcmp 0 = if pop "0" then atoi swap + intostr loc @ swap "_credits/" arg @ part_pmatch intostr strcat swap 1 addprop loc @ "_auction/curbidder" getpropstr loc @ swap "_credits/" swap strcat getpropstr dup "" stringcmp 0 = if pop "0" then atoi swap - intostr loc @ swap "_credits/" loc @ "_auction/curbidder" getpropstr strcat swap 1 addprop loc @ "_auction/auctioned" remove_prop loc @ "_auction/curbid" remove_prop loc @ "_auction/curbidder" remove_prop loc @ me @ " " notify_except "Bidding ended on " arg @ part_pmatch name strcat "." strcat .tell me @ name " ends the bidding on " arg @ part_pmatch name strcat strcat "." strcat loc @ swap me @ swap notify_except loc @ me @ " " notify_except ; : bid arg @ number? not if "You must specify an amount to bid." .tell exit then loc @ "_auction/auctioneer" getpropstr dup "" stringcmp 0 = if pop loc @ owner else atoi dbref then me @ dbcmp if "The auctioneer cannot bid." .tell exit then loc @ "_auction/auctioned" getpropstr dup "" stringcmp 0 = if pop "There is no-one up for bid." .tell exit then atoi dbref me @ dbcmp if "You cannot bid on yourself!" .tell exit then loc @ "_credits/" me @ intostr strcat getpropstr dup "" stringcmp 0 = if pop "0" then atoi arg @ atoi > not if "You don't have enough " getcredits strcat " to bid that much." strcat .tell exit then loc @ "_auction/curbid" getpropstr dup "" stringcmp 0 = if pop "0" then atoi arg @ atoi < not if "That isn't more than the current bid." .tell exit then loc @ "_auction/curbid" arg @ strip 1 addprop loc @ "_auction/curbidder" me @ intostr 1 addprop "You bid " arg @ strip " " getcredits " on " loc @ "_auction/auctioned" getpropstr atoi dbref name "." strcat strcat strcat strcat strcat strcat .tell loc @ me @ " " notify_except me @ name " bids " arg @ strip " on " strcat strcat strcat loc @ "_auction/auctioned" getpropstr atoi dbref name "!" strcat strcat loc @ swap me @ swap notify_except loc @ me @ " " notify_except ; : give arg @ "=" explode 2 = not if "Syntax: give =" .tell exit then arg @ "=" explode pop swap pop part_pmatch dup #-1 dbcmp if pop "Give credit to whom?" .tell exit then dup #-2 dbcmp if pop "Give credit to whom?" .tell exit then location loc @ dbcmp not if "Give money to whom?" .tell exit then arg @ "=" explode pop pop atoi loc @ "_credits/" me @ intostr strcat getpropstr dup "" stringcmp 0 = if pop "0" then atoi < not if "You don't have that much in your account." .tell exit then arg @ "=" explode pop swap pop part_pmatch loc @ "_credits/" rot intostr strcat getpropstr dup "" stringcmp 0 = if pop "0" then atoi arg @ "=" explode pop pop atoi + intostr loc @ "_credits/" arg @ "=" explode pop swap pop part_pmatch intostr strcat rot 1 addprop loc @ "_credits/" me @ intostr strcat getpropstr atoi arg @ "=" explode pop pop atoi - intostr loc @ swap "_credits/" me @ intostr strcat swap 1 addprop "You give " arg @ "=" explode pop pop strcat " " strcat getcredits strcat " to " strcat arg @ "=" explode pop swap pop part_pmatch name strcat "." strcat .tell me @ name " gives you " strcat arg @ "=" explode pop pop strcat " " strcat getcredits strcat "." strcat arg @ "=" explode pop swap pop part_pmatch swap notify ; : get_info dup location loc @ dbcmp not if pop "*none*" exit then "biddinginfo" getpropstr dup "" stringcmp 0 = if pop pop "*none" exit then ; : status " " .tell "Up for bid: " loc @ "_auction/auctioned" getpropstr dup "" stringcmp 0 = if pop "*no-one*" else atoi dbref name then strcat .tell " " .tell "Bidding information:" .tell loc @ "_auction/auctioned" getpropstr dup "" stringcmp 0 = if pop "*none*" else atoi dbref get_info then .tell " " .tell "Current bid: " loc @ "_auction/curbid" getpropstr dup "" stringcmp 0 = if pop "0" then strcat " " strcat getcredits strcat " " strcat 40 strcut pop "Bidder: " strcat loc @ "_auction/curbidder" getpropstr dup "" stringcmp 0 = if pop "*no-one*" else atoi dbref name then strcat .tell "Auctioneer: " loc @ "_auction/auctioneer" getpropstr dup "" stringcmp 0 = if pop loc @ owner else atoi dbref then name strcat .tell " " .tell ; : clear loc @ "_auction/auctioneer" getpropstr dup "" stringcmp 0 = if pop loc @ owner else atoi dbref then me @ dbcmp not if "You aren't allowed to clear the bid." .tell exit then "Clearing bidding props ..." .tell loc @ "_auction/auctioneer" remove_prop loc @ "_auction/auctioned" remove_prop loc @ "_auction/curbid" remove_prop loc @ "_auction/curbidder" remove_prop "Bidder, biddee, bid and auctioneer name reset." .tell ; : help1 "AuctionClone.MUF v1.0 by Ginger@FurToonia" .tell " " .tell "To make a bid: bid " .tell "To see the current bid: status" .tell "To see how many " getcredits " you have: check" strcat strcat .tell "To give " getcredits " to another player: give =" strcat strcat .tell "To set your bidding information: @set me=biddinginfo:" .tell "To see others' bidding info: bid #info " .tell " " .tell "The auctioneer can neither start bidding on hirself nor bid on others." .tell "You cannot bid on players who are asleep or not in the same room, or on" .tell "players who are not currently up for bid. You can see bidding info only" .tell "on players who are in the room and awake." .tell "Type " command @ strcat " #help2 for admin/auctioneer commands." strcat .tell ; : help2 "ADMIN COMMANDS" .tell " " .tell "To start the bidding: start bid " .tell "To end the bidding: end bid " .tell "To add to a player's account: credit =" .tell "To check the account of any player: check " .tell "To clear the bidding/end auction: bid #clear" .tell " " .tell "@set here=_auction/creditsname:credits [to change the name of the money]" .tell "The room owner can also 'bid #admin ' to make the auctioneer." .tell ; : setadmin arg @ strip " " explode pop pop part_pmatch dup #-1 dbcmp if "Who do you want to be auctioneer?" .tell exit then dup #-2 dbcmp if "Which one?" .tell exit then loc @ swap "_auction/auctioneer" swap intostr 1 addprop arg @ strip " " explode pop pop part_pmatch name " will be the auctioneer." strcat .tell ; : info arg @ " " explode pop pop dup arg ! part_pmatch dup #-1 dbcmp if pop "I don't see that here." .tell exit then dup #-2 dbcmp if pop "Which one?" .tell exit then dup location loc @ dbcmp not if pop "I don't see that here." .tell exit then dup "Bidding info for: " swap name strcat .tell " " .tell "biddinginfo" getpropstr dup "" stringcmp 0 = if pop "*none*" then .tell ; : main dup strip "#help" stringcmp 0 = if pop help1 exit then dup strip "#help2" stringcmp 0 = if pop help2 exit then dup strip "#clear" stringcmp 0 = if pop clear exit then dup strip "#info" stringpfx 1 = if arg ! info exit then dup strip "#admin" stringpfx 1 = if arg ! setadmin exit then arg ! command @ "check" stringcmp 0 = if check exit then command @ "credit" stringcmp 0 = if credit exit then command @ "start bid" stringcmp 0 = if start_bid exit then command @ "end bid" stringcmp 0 = if end_bid exit then command @ "bid" stringcmp 0 = if bid exit then command @ "give" stringcmp 0 = if give exit then command @ "status" stringcmp 0 = if status exit then ;