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 12-03-2004, 06:13 PM   #1 (permalink)
Forum Expert
 
Join Date: Jul 2003
Location: Arizona
Age: 18
Posts: 3,186
Send a message via AIM to Storm33229 Send a message via Yahoo to Storm33229
Default Console Help

Ok, i was just curios and needed some help on what i can do with consoles!

Well i figured out how to make the console write lines:
Code:
console.writeline ("text");
so i was wandering if there was any thing else i can do i consoles...

preferebley make it so i can ask a question and then a random anser comes up...

Also how do i let the user write a line in for an answer??

If i knew this itd solve my problem hehe
Storm33229 is offline   Reply With Quote
Old 12-03-2004, 08:16 PM   #2 (permalink)
Forum Expert
 
Join Date: Oct 2003
Location: Calhoun, Ga
Age: 44
Posts: 1,008
Send a message via AIM to roadmaster
Default

Quote:
preferebley make it so i can ask a question and then a random anser comes up...

Also how do i let the user write a line in for an answer??

If i knew this itd solve my problem hehe
Console.WriteLine wont do that by itself, you need to write your own script to have that functionality, if you dont know how to script then you will need to learn or become a subscriber and request it in the subscriber forums...


roadmaster
roadmaster is offline   Reply With Quote
Old 12-03-2004, 08:50 PM   #3 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Console.Readline
Phantom is offline   Reply With Quote
Old 12-03-2004, 11:36 PM   #4 (permalink)
Forum Expert
 
Join Date: Jul 2003
Location: Arizona
Age: 18
Posts: 3,186
Send a message via AIM to Storm33229 Send a message via Yahoo to Storm33229
Default

so i enter Console.Readline then that enables me to type stuff in??

if so would i do:

Code:
get Answer
then answer would be scripted as a class...

wich would be

Code:
Answer = (utility.random (yes,no));
Storm33229 is offline   Reply With Quote
Old 12-04-2004, 12:04 AM   #5 (permalink)
Forum Expert
 
Join Date: Jul 2003
Location: Arizona
Age: 18
Posts: 3,186
Send a message via AIM to Storm33229 Send a message via Yahoo to Storm33229
Default

what i mean by this is:
Code:
using System;

namespace EightBall
{
class MainClass
{
 
 public static void Main(string[] args)
 {
  Console.WriteLine ("what is your question");
  Console.ReadLine();
  Console.get (answer);
 }
}
}
or other is:

Code:
  Console.WriteLine ("what is your question");
  Console.ReadLine();
  get (answer);
But without it having console (me not being at MY computer i cant use my debbugger so i dont know if it would write the answer onto the console.
Storm33229 is offline   Reply With Quote
Old 12-04-2004, 12:09 AM   #6 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Code:
Console.get (answer);
That makes no sense whats so ever.

Come back after your at your computer, not going to waste my time trying to help you if your going to claim thats suppose to be valid code.
Phantom is offline   Reply With Quote
Old 12-04-2004, 12:25 AM   #7 (permalink)
Moderate
 
David's Avatar
 
Join Date: Nov 2002
Location: USA
Posts: 6,598
Default

Only the Admin will ever see the Console. It will only display on the pc that is actually running the server, not on client computers.
__________________
David Forum Moderator
The RunUO.com Forum Moderator Team

Forum Rules and Guidelines
RunUO Forum Search Engine
Download RunUO 2.0 RC2
David is offline   Reply With Quote
Old 12-04-2004, 12:28 AM   #8 (permalink)
Forum Expert
 
Join Date: Jul 2003
Location: Arizona
Age: 18
Posts: 3,186
Send a message via AIM to Storm33229 Send a message via Yahoo to Storm33229
Default

lol, well i am sorry but this is my first time trying to code an actuall program... so I just go by what makes just a little sense...

when i say Console.get (answer); i am saying the console should Write the answer on a line just like ud say Console.WriteLine("text");
Storm33229 is offline   Reply With Quote
Old 12-04-2004, 12:34 AM   #9 (permalink)
Moderate
 
David's Avatar
 
Join Date: Nov 2002
Location: USA
Posts: 6,598
Default

Code:
string answer = Console.ReadLine();
__________________
David Forum Moderator
The RunUO.com Forum Moderator Team

Forum Rules and Guidelines
RunUO Forum Search Engine
Download RunUO 2.0 RC2
David is offline   Reply With Quote
Old 12-04-2004, 12:49 AM   #10 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Like I said...

Come back when you can actually test your ideas, otherwise were just doing the work which is a waste of time.
Phantom is offline   Reply With Quote
Old 12-04-2004, 01:28 AM   #11 (permalink)
Forum Expert
 
Join Date: Jul 2003
Location: Arizona
Age: 18
Posts: 3,186
Send a message via AIM to Storm33229 Send a message via Yahoo to Storm33229
Default

thank you david and sorry phantom... i would have tested that if i was there
any ways david as for CONSOLES uhm this script isnt for ruo hehe its just a program. i was told get good @ C then do RUO so thats what im trying to accomplish... and i wanted this to be my first program
Storm33229 is offline   Reply With Quote
Old 12-04-2004, 01:34 AM   #12 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

I really hope your not learning C or your in trouble..

Because the differences between C and C# are to many to list on 100mb text document.
Phantom is offline   Reply With Quote
Old 12-04-2004, 02:43 AM   #13 (permalink)
Forum Expert
 
Join Date: Aug 2004
Location: Redmond, WA
Age: 21
Posts: 1,288
Send a message via AIM to Sep102 Send a message via MSN to Sep102
Default

And since when does C have namespaces (or structures supporting methods) Phantom? I don't believe I've ever seen Console.WriteLine used in a C program before .
Sep102 is offline   Reply With Quote
Old 12-04-2004, 03:02 AM   #14 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Which is my point...

Read what he said, there is a big difference between the two.
Phantom is offline   Reply With Quote
Old 12-04-2004, 03:07 AM   #15 (permalink)
Forum Expert
 
Join Date: Aug 2004
Location: Redmond, WA
Age: 21
Posts: 1,288
Send a message via AIM to Sep102 Send a message via MSN to Sep102
Default

And my point, he obviously meant C# instead of C. He wouldn't be writing code such as that if he were learning C, you know, after all, not a line of that code that he wrote would work in a C program.

On the other side, if he is trying to learn C and not C#, I agree, long ways off.
Sep102 is offline   Reply With Quote
Old 12-04-2004, 11:19 AM   #16 (permalink)
Forum Expert
 
Join Date: Jul 2003
Location: Arizona
Age: 18
Posts: 3,186
Send a message via AIM to Storm33229 Send a message via Yahoo to Storm33229
Default

lol i thot they were the same
i just thot C and C# were same but C just didnt have the # thing on it
Storm33229 is offline   Reply With Quote
Old 12-04-2004, 12:47 PM   #17 (permalink)
Moderate
 
David's Avatar
 
Join Date: Nov 2002
Location: USA
Posts: 6,598
Default

The point being he is trying to learn. Phantom, isn't that what you get worked up about others not doing?

Storm ask your questions, if you get flamed report the post and I will take a look.

(And no, not the same at all really. Most say C# is closer to java that it is to C, I never learned java though...)
__________________
David Forum Moderator
The RunUO.com Forum Moderator Team

Forum Rules and Guidelines
RunUO Forum Search Engine
Download RunUO 2.0 RC2
David is offline   Reply With Quote
Old 12-04-2004, 03:09 PM   #18 (permalink)
Forum Expert
 
Join Date: Aug 2004
Location: Redmond, WA
Age: 21
Posts: 1,288
Send a message via AIM to Sep102 Send a message via MSN to Sep102
Default

Yes, C# is much closer to Java than to C or C++ (though it is much closer to C++ than to C). C# is supposed to be Microsoft's answer to Java, thus C# rips off a lot of Java's features and adds some of its own.
Sep102 is offline   Reply With Quote
Old 12-04-2004, 03:51 PM   #19 (permalink)
Forum Expert
 
Join Date: Jul 2003
Location: Arizona
Age: 18
Posts: 3,186
Send a message via AIM to Storm33229 Send a message via Yahoo to Storm33229
Default

thank you and i noticed that flash and VB have similar commands but i dont think vb and flash have name space lines of code.
Storm33229 is offline   Reply With Quote
Old 12-04-2004, 06:26 PM   #20 (permalink)
Forum Expert
 
Join Date: Jul 2003
Location: Arizona
Age: 18
Posts: 3,186
Send a message via AIM to Storm33229 Send a message via Yahoo to Storm33229
Default

I have received help from a friend of mine and his said this is the correct code:

Code:
  using System;
 
 namespace EightBall
 {
 	class EightBall
 	{
   [STAThread]
   static void Main(string[] args)
   {
   	Console.Write("What is your question? ");
   	string answer = Console.ReadLine();
 
   	Console.Write("The answer to your question > " + answer + " is ");
 
   	Random numb = new Random();
   	int ans = numb.Next(2);
   	switch(ans)
   	{
     case 0: Console.WriteLine("yes");break;
     case 1: Console.WriteLine("no");break;
   	}
   }
 	}
 }
And
Code:
random numb
is randone case basically ( i think ) and
Code:
int ans = numb.next(2);
is the number of cases.

well my question is why did he say
Code:
 = new random();
when you already have the random
or is it just like alot of things in runuo u have to create them along with declaring them??

PS. your code
Code:
utility.random
( I just learned ) dosnt work for the rest of C# it just works for RUO lol
Storm33229 is offline   Reply With Quote
Old 12-04-2004, 08:53 PM   #21 (permalink)
Forum Expert
 
Join Date: Jul 2003
Location: Arizona
Age: 18
Posts: 3,186
Send a message via AIM to Storm33229 Send a message via Yahoo to Storm33229
Default

??
Storm33229 is offline   Reply With Quote
Reply

Bookmarks


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