Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-28-2009, 07:52 PM
Unkownsoldier Unkownsoldier is offline
Ignorance has no future
Join Date: Sep 2008
Posts: 1,287
Unkownsoldier is on a distinguished road
Tip Jar Help.

Currently, on Unholy Nation, there is a restaraunt called "The Crab Shack", currently it looks great and has a lot of good qualities. However, the tip jar is broken.

I need a script that would allow money to go into the jar when someone says /tip #. This would be collected in a chest, now I would need to access this money for paying someone /pay account #. Only this /pay commands can only be used for someone wearing the tag (Crab Shack Manager).

If anyone is not busy, or is looking for a challenge could you help me out please.
__________________
Look beyond the monitor.
Reply With Quote
  #2  
Old 06-28-2009, 07:55 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Forum Rules
1. Be clear on your ability level. In other words, do not post asking for scripts, or asking people to fix scripts that are above your ability level. If you are writing a script to aid learning, then try writing a simpler script. If you are looking for a script for a server, then the best solution is probably to hire a scripter.
You could at least try and make it on your own, and then ask us what's wrong with it.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #3  
Old 06-28-2009, 07:56 PM
Unkownsoldier Unkownsoldier is offline
Ignorance has no future
Join Date: Sep 2008
Posts: 1,287
Unkownsoldier is on a distinguished road
I am not a scripter, and currently this is a major part of the restaurant. All of Unholy Nations scripters are currently busy with projects and I need to complete this to implement money back into the economy. I am not saying someone has to do this, just if they have free time it would be a nice gesture.
__________________
Look beyond the monitor.
Reply With Quote
  #4  
Old 06-28-2009, 07:58 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Well.. Here's one piece of the puzzle!

PHP Code:
if (player.rupees amount) {
  
player.rupees -= amount;
  
this.tipjar += amount;

Keep in mind this.tipjar will reset if the level is updated / server goes down. So you will probably want to use a server. or something..
__________________
Quote:
Reply With Quote
  #5  
Old 06-28-2009, 08:01 PM
Unkownsoldier Unkownsoldier is offline
Ignorance has no future
Join Date: Sep 2008
Posts: 1,287
Unkownsoldier is on a distinguished road
Ya I wish I knew what piece it was tho.
__________________
Look beyond the monitor.
Reply With Quote
  #6  
Old 06-28-2009, 08:04 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by Unkownsoldier View Post
Ya I wish I knew what piece it was tho.

It's in GS2 so you wouldn't be able to use it in the offline editor anyways. You should really just let the server staff do this since it would be better for them to just make some type of donation chest class and all you would have to do is join it with a level NPC.

A system like this would require the use of some type of server. var or a database to store the amounts to prevent the tips from resetting each time the level is reset so you should really leave it to the staff. It's easy to make, it wouldn't take them much time.
Reply With Quote
  #7  
Old 06-28-2009, 08:08 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
a tips to do offline GS2, GScript2 Syntax Highlighting for Notepad++
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #8  
Old 06-28-2009, 08:08 PM
SwimChao SwimChao is offline
UN Manager
SwimChao's Avatar
Join Date: Feb 2009
Posts: 486
SwimChao is just really niceSwimChao is just really nice
Actually, I'm going to have Lloyd make one base for all around UN instead.

However, for future reference that script asks if the player actually has the gralats ("rupees") to donate. If they do, it subtracts it from then, and adds it to the tip jar.
__________________
People wake up hatin' and they ain't even brushed they teeth yet.
Reply With Quote
  #9  
Old 06-28-2009, 08:18 PM
cyan3 cyan3 is offline
Registered User
cyan3's Avatar
Join Date: Nov 2005
Location: England
Posts: 2,919
cyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant future
Quote:
Originally Posted by Deas_Voice View Post
The text editor I use has GScript2 syntax highlighting by default.
Attached Thumbnails
Click image for larger version

Name:	graalhighlighting.png
Views:	168
Size:	434.8 KB
ID:	48811  
Reply With Quote
  #10  
Old 06-28-2009, 09:08 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by cyan3 View Post
The text editor I use has GScript2 syntax highlighting by default.
Yea, well, Linux. Graal delivers syntax highlighting files when downloading RC.
Reply With Quote
  #11  
Old 06-28-2009, 09:58 PM
Robin Robin is offline
The secret of NIMH
Robin's Avatar
Join Date: Apr 2005
Location: Wales, UK
Posts: 515
Robin will become famous soon enough
Send a message via AIM to Robin
I have gedit for windows installed. Can I get those syntax highlighting files please?
__________________

Reply With Quote
  #12  
Old 06-28-2009, 10:27 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
I have no idea if that's the only stuff required, but navigate to C:\Documents and Settings\USERNAMEHERE\.gnome2\gtksourceview-1.0\language-specs\. graal.lang looks convincing ;D
Reply With Quote
  #13  
Old 06-28-2009, 11:08 PM
Robin Robin is offline
The secret of NIMH
Robin's Avatar
Join Date: Apr 2005
Location: Wales, UK
Posts: 515
Robin will become famous soon enough
Send a message via AIM to Robin
graal.lang is there, but Graal as a syntax type is not there.
__________________

Reply With Quote
  #14  
Old 06-29-2009, 12:42 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Bleh, I tend to just browse over syntax hilighting anywas... I'm so impatient.
Reply With Quote
  #15  
Old 06-29-2009, 01:46 AM
cyan3 cyan3 is offline
Registered User
cyan3's Avatar
Join Date: Nov 2005
Location: England
Posts: 2,919
cyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant future
In my opinion the internal text editor for the remote control should have syntax highlighting because I usually use levels to test my scripts.
Reply With Quote
  #16  
Old 06-29-2009, 09:45 AM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by Crow View Post
I have no idea if that's the only stuff required, but navigate to C:\Documents and Settings\USERNAMEHERE\.gnome2\gtksourceview-1.0\language-specs\. graal.lang looks convincing ;D
or C:\Users\USERNAMEHERE\.gnome2\gtksourceview-1.0\language-specs\ for vista
can you use it in the notepad++?
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #17  
Old 06-29-2009, 09:57 AM
Robin Robin is offline
The secret of NIMH
Robin's Avatar
Join Date: Apr 2005
Location: Wales, UK
Posts: 515
Robin will become famous soon enough
Send a message via AIM to Robin
I am using Windows 7, and I found it.

The reason it was not working for me was because the new gedit uses gtksourceview-2.0, so I copied graal.lang to "CProgram Files (x86)\gedit\share\gnome2\gtksourceview-2.0\language-specs\" or so
__________________

Reply With Quote
  #18  
Old 06-29-2009, 11:39 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Deas_Voice View Post
or C:\Users\USERNAMEHERE\.gnome2\gtksourceview-1.0\language-specs\ for vista
can you use it in the notepad++?
Nah, but I already used that as a reference when creating my Notepad++ syntax highlighting. I think I accidently left some things out, should check again and add them ;D But the files Graal provides are for GTK only, which makes sense since RC uses GTK. Notepad++ does not, though.
Reply With Quote
  #19  
Old 07-02-2009, 03:33 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
PHP Code:
// Created by Pelikano (Sam) for Unkownsoldier, wtf you spelled your Acc wrong dude o.o
function onCreated() {
  
sethape(1,32,32);
  
setimg("chest.png");
}
function 
onPlayerChats() {
  if (
player.chat.starts("/tip")) {
    
temp.money player.chat.substring(5);
    if (
player.rupees money) {
      
serverr.crabshack += money;
      
player.rupees -= money;
      
player.chat "Donated" SPC money;
    }
    else {
      
player.chat "Not enough Rupees!";
    }
  }
  if (
player.chat.starts("/pay") && player.guild == "Crab Shack Manager") {
    
temp.player.chat.tokenize(" ");
    if (
FindPlayerByCommunityName(t[1]) != -1) {
      if (
serverr.crabshack >= t[2]) {
        
FindPlayerByCommunityName(t[1]).rupees += t[2];
        
serverr.crabshack -= t[2];
        
player.chat "Paid" SPC t[1SPC t[2SPC "Gralats!";
      }
      else {
        
player.chat "Not enough Money in the safe!";
      }
    }
    else {
      
player.chat "Player was not found!";
    }
  }

Did something real quick so you have something rofl.
Probably shouldn't be used on UN tho, since I am using serverr.vars,

Last edited by Pelikano; 07-02-2009 at 08:47 PM..
Reply With Quote
  #20  
Old 07-02-2009, 03:39 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Pelikano View Post
PHP Code:
... 
Did something real quick so you have something rofl.
Probably shouldn't be used on UN tho, since I am using serverr.vars,
You're also mixing server. and serverr.

__________________
Reply With Quote
  #21  
Old 07-02-2009, 06:47 PM
MysticX2X MysticX2X is offline
Prince
MysticX2X's Avatar
Join Date: Sep 2005
Posts: 2,529
MysticX2X will become famous soon enough
I think he just made a typo.
__________________
-Mystic

former acc: mystic2k


RIP Matt (NBK)
Reply With Quote
  #22  
Old 07-02-2009, 07:43 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by MysticX2X View Post
I think he just made a typo.
I guess so. I just wanted to point it out
__________________
Reply With Quote
  #23  
Old 07-02-2009, 08:47 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
that's a major mistake, sry, fixed rofl
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.