Go Back   RunUO - Ultima Online Emulation > RunUO > Script Support

Script Support Get support for modifying RunUO Scripts, or writing your own!

Reply
 
Thread Tools Display Modes
Old 06-19-2008, 08:49 AM   #1 (permalink)
Forum Expert
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 455
Default Some very small issues with a craft tool gump im working on

Hey everyone how you all!! O_0

uhm, im just working on a small gump, that has 7 buttons, and each one gives a different crafting tool.

The script is as follows:

Code:
using Server;
using System;
using Server.Gumps;
using Server.Commands;
using Server.Network;

namespace Server.Gumps
{
    public class ToolGump : Gump
    {
        public ToolGump()
            : base(347, 216)
        {
            this.Closable = true;
            this.Disposable = false;
            this.Dragable = true;
            this.Resizable = false;
            this.AddPage(0);

            this.AddBackground(0, 0, 298, 390, 2600);

            this.AddLabel(88, 10, 1171, @"Crafting Tools");
            this.AddLabel(89, 63, 1159, @"Smith Hammer");
            this.AddLabel(89, 108, 1159, @"Fletching Tools");
            this.AddLabel(89, 152, 1159, @"Saw");
            this.AddLabel(89, 198, 1159, @"Hatchet");
            this.AddLabel(89, 243, 1159, @"Pickaxe");
            this.AddLabel(89, 288, 1159, @"Sewing Kit");
            this.AddLabel(89, 334, 1159, @"Tinkers Tools");

            this.AddButton(208, 63, 247, 248, 1, GumpButtonType.Reply, 0);
            this.AddButton(208, 108, 247, 248, 2, GumpButtonType.Reply, 0);
            this.AddButton(208, 152, 247, 248, 3, GumpButtonType.Reply, 0);
            this.AddButton(208, 198, 247, 248, 4, GumpButtonType.Reply, 0);
            this.AddButton(208, 243, 247, 248, 5, GumpButtonType.Reply, 0);
            this.AddButton(208, 288, 247, 248, 6, GumpButtonType.Reply, 0);
            this.AddButton(208, 334, 247, 248, 7, GumpButtonType.Reply, 0);

            this.AddItem(13, 63, 5091, 0);
            this.AddItem(7, 108, 4130, 0);
            this.AddItem(3, 152, 4148, 0);
            this.AddItem(19, 198, 3907, 0);
            this.AddItem(9, 243, 3718, 0);
            this.AddItem(0, 288, 3997, 0);
            this.AddItem(9, 334, 7864, 0);


        }

        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile m = sender.Mobile;

            switch (info.ButtonID)
            {
                case 0:
                    {
                        m.SendMessage( 68, "You choose not to create any tools.");
                        return;
                    }
                case 1:
                    {
                        m.SendMessage("You have created a smith hammer");
                        m.Backpack.DropItem( new ( SmithHammer ));
                    }

                case 2:
                    {

                    }

                case 3:
                    {

                    }

                case 4:
                    {

                    }

                case 5:
                    {

                    }

                case 6:
                    {

                    }
            		
            	case 7:
            		{

            		}
            }
        }
    }
}
I just need to get that first case sorted, and then I will be able to add the other tools into the 6 other cases, the error it gives is:

error line 64: expected

PHP Code:
this is line 64:
m.Backpack.DropItem( new ( SmithHammer )); 
Im running runUO 2.0 RC1

thanks for the help

regards
__________________
legendsofkaine.page.tl
typhoonbot is online now   Reply With Quote
Old 06-19-2008, 09:33 AM   #2 (permalink)
Forum Expert
 
Soteric's Avatar
 
Join Date: Aug 2006
Location: Russia, Rostov-on-Don
Posts: 461
Send a message via ICQ to Soteric
Default

Every case section should end with "return" command (finishing the whole method), "break" command (finishing switch section) or "goto N" command (start doing N case section)

Last edited by Soteric; 06-19-2008 at 09:58 AM.
Soteric is offline   Reply With Quote
Old 06-19-2008, 09:40 AM   #3 (permalink)
Forum Expert
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 455
Default

oh dont joke O_0

if that is the problem I am going to be so pissed, I spent hours trying all different things, thinking "there cannot be anything wrong with what ive got here"

meanwhile I had a return there, I just pasted over it when I copied different selections of code into that area

ill try that now and get back to ya

ta
__________________
legendsofkaine.page.tl
typhoonbot is online now   Reply With Quote
Old 06-19-2008, 09:49 AM   #4 (permalink)
Forum Expert
 
Soteric's Avatar
 
Join Date: Aug 2006
Location: Russia, Rostov-on-Don
Posts: 461
Send a message via ICQ to Soteric
Default

oops... and the main issue

m.Backpack.DropItem( new ( SmithHammer ));

should be

m.Backpack.DropItem( new SmithHammer() );
Soteric is offline   Reply With Quote
Old 06-19-2008, 10:07 AM   #5 (permalink)
Forum Expert
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 455
Default

Haha, as I put those exact things into the coding, I refreshed this page while I was waiting for it to compile...*waits some more*.......ERRORS!!

ok, now it tunes me some other error:

Line 64: type or namespace 'SmithHammer' could not be found <are you using missing directive or assembly ref>

Line 64: The best overload method match for 'server.items.container.Dropitem<server.item> has some invalid arguments

Line 64: argument '1': cannot convert from 'SmithHammer' to 'server.item'

any suggestions ?

thanks again for your help thus far
__________________
legendsofkaine.page.tl
typhoonbot is online now   Reply With Quote
Old 06-19-2008, 10:16 AM   #6 (permalink)
Forum Expert
 
Soteric's Avatar
 
Join Date: Aug 2006
Location: Russia, Rostov-on-Don
Posts: 461
Send a message via ICQ to Soteric
Default

Add 'using Server.Items;"
Soteric is offline   Reply With Quote
Old 06-19-2008, 11:13 AM   #7 (permalink)
Forum Expert
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 455
Default

Ahahahhaha omw after all of that, I forgot Server.Items at the top grrrr, sometimes I make myself angry

thank you very much for the help, really appreciated
__________________
legendsofkaine.page.tl
typhoonbot is online now   Reply With Quote
Reply

Bookmarks

Tags
gump, issues


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5