Macro Facility

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Macro Facility

Post by Paul Stevens »

From an RTC forum:
You can also use an external program to create a macro that repeadtley
presses mouse1 for you, so you can leave it training and make coffee
I think it would be relatively easy to make an "internal"
macro facility for CSBwin. It could even be responsive to
the monsters/objects/Mana/Stamina/etc. Perhaps
macros could be called up using Control Keys. CTRL-A would
call a file named Macro_A.txt, for example.

I don't know how complex such things could be but it would
be interesting to make a start. A macro to pick up an object,
throw it, and repeat until stamina, food, or water gives out.

Any ideas about this? What mightit be useful for?
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Can only see it as a training aid really
sk
Novice
Posts: 13
Joined: Sat Feb 28, 2004 11:33 pm
Location: Helsinki, Finland
Contact:

Re: Macro Facility

Post by sk »

Paul Stevens wrote:From an RTC forum:
I don't know how complex such things could be but it would
be interesting to make a start. A macro to pick up an object,
throw it, and repeat until stamina, food, or water gives out.

Any ideas about this? What mightit be useful for?
Extend that idea to a scripting interface so we can make our own DM bots .)
sk@IRCnet/Quakenet #nethack #DungeonMaster etc
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Well, since I don't know what a "DM bot" is I cannot say
whether this would be easy, possible, difficult, or what.

Can you give an idea of what such a 'script' would look
like? A complete, though simple, example? And what
it is supposed to accomplish?
sk
Novice
Posts: 13
Joined: Sat Feb 28, 2004 11:33 pm
Location: Helsinki, Finland
Contact:

Post by sk »

Paul Stevens wrote:Well, since I don't know what a "DM bot" is I cannot say
whether this would be easy, possible, difficult, or what.

Can you give an idea of what such a 'script' would look
like? A complete, though simple, example? And what
it is supposed to accomplish?
I meant an interface to do scripts that can command champions as a player can.

example
sub cast_spell(spell_to_cast, champion_color) {
# .. code that makes champion of champion_color to cast
# .. spell_to_cast
}

And means to creat logic when to call such functions (AI). I guess the mouse driven ui would make this difficult.. this really was just a quick idea, i have absolutely no clue if this even is possible. Picking things up etc would be a problem i guess.

Well, anyway, that is what i meant.

The ultimate idea would be to create a script that can finish DM or CSB :)
sk@IRCnet/Quakenet #nethack #DungeonMaster etc
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Yes. That is exactly what I was proposing. Except that
the macro "PlayEntireGame" is going to be difficult for
you to write. Not difficult to provide the tools and hooks
to make writing it possible. And who knows? If the game
can be played in 20 minutes perhaps some clever person
could write a script (or macro) to play a significant part.

By the way. Such scripts exist. We called them 'Movies'
and they were written by actually playing the game.
Guest

Post by Guest »

Paul Stevens wrote: By the way. Such scripts exist. We called them 'Movies'
and they were written by actually playing the game.
Yes i know. AI is still different than a human played game.
sk
Novice
Posts: 13
Joined: Sat Feb 28, 2004 11:33 pm
Location: Helsinki, Finland
Contact:

Post by sk »

Anonymous wrote:Yes i know. AI is still different than a human played game.
This was me. I still seem to forget to check if i'm logged in or not.
sk@IRCnet/Quakenet #nethack #DungeonMaster etc
User avatar
cowsmanaut
Moo Master
Posts: 4380
Joined: Fri Jun 30, 2000 12:53 am
Location: canada

Post by cowsmanaut »

not sure if this helps at all but Maya and XSI (3d modeling software) have their own scripting languages based on programming languages XSI is easier to follow I think since it uses vbscript or Java script for it's functions which are over all easier than Maya's Mell which is based on C++ coding. Anyway, the way in which they make it even easier for the user is that for every action that is commited a log is produced which contains the code for each function. an example of this code is as follows

Code: Select all

CreatePrim "Cube", "MeshSurface"
SetValue "cube.cube.length", 18.245
SetValue "cube.polymsh.geom.subdivu", 9
SetValue "cube.polymsh.geom.subdivv", 9
so to follow this it's creatign a primitive shape which is calling cube, the "meshsurface" means it's a polygons surface. Then gives it a set length I asked for then the number of subdivisions in the U and V directions.

so, what about something like this but related to DM isntead of polygons and such.

Code: Select all

castspell (3,3,0,0) char1
sleep dur=00.01.00
select item"apple" char1, loc18
consume item="apple", char1
select item="falchion", char1, loc3
place item="falchion", char1, loc15
I dunno something like that? so the cast spell would be 3rd character pressed twice which is 3rd power light spell yes? the 0 indicates nothing pressed. so number 0-6 represent the icons.

sleep dur .. sleep is command dur is the duration hours:mins:seconds so it calculates when you are woken and then places the duration of sleep.

select item then the name of the item char1 is chatracter 1.. other options could be floor or alcove.. the location number (loc15) reffers to the location of the object in the storage heirarchy however that's set up in DM.

you get the idea I guess from the rest.. just some thoughts..

moo
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

cowsmanaut:

In order to be useful (IMHO) there must be conditional
constructs. Instantly you have a much more complicated
language. You have to be able to say things like:

Code: Select all

IF MonsterAt(0,0)  //(0,0) relative is directly ahead
  IF Mana(green) is greater than 20
  THEN
    CastSpell(Green,zo,kath,ra)
  ELSE
    IF Mana(Blue) is greater than 20
    THEN
      CastSpell(Blue,zo,kath,ra)
    ELSE
      TouchHand(Blue,Left) //Cursor known to be empty.
      Punch(Blue)
      TouchHand(blue,Left) //Put item back into attack hand
    ENDIF
  ENDIF
ENDIF
Or the equivalent with Curly Braces and some sort of
commenting ability.
User avatar
Lunever
Grand Druid
Posts: 2712
Joined: Thu Feb 14, 2002 4:47 pm

Post by Lunever »

Doesn't even need to be that complex. I imagine I'd be quite happy with a macro that makes the 2 front fighters attack, then immediately following releases spells (shoots fireballs) from all 4 characters and finally "reloads" the artillery i.e. creates MonFulIr runes for all 4 characters...
Parting is all we know from Heaven, and all we need of hell.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

That should be relatively easy to do. Give me a few weeks
(I am currently rather excited about this Pocket PC project)
and let me make such a macro as a very special case. Not
with a script language but as a special case. Just to test
the feasibility of processing macros at runtime and to give you
a feeling of how it might work while playing a game.
Post Reply

Return to “Chaos Strikes Back for Windows & Linux (CSBWin) / CSBuild”