#(Godline) Simple Dice Game

52 messages · Page 1 of 1 (latest)

raven robin
#

Hello, It's my first try in Denizen scripting, so here it is Simple Dice Game:

https://paste.denizenscript.com/View/107146
Dealer and Player rolls three dices, whose summary is more - wins.
If player wins, his bet doubled, otherwise his bid burns out.
Make a bid with item in right hand.

Code could be silly, waiting for advises if so.

worthy citrusBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

drifting halo
#

o-0 it's quite a good start, it's just a bit overcomplicated lol

#

May I ask if you have any prior experience programming?

gentle coralBOT
# drifting halo !ds https://paste.denizenscript.com/View/107146
Script Check Results
Script Warnings

On line 27, 29, 40, 43: Definition tag points to non-existent definition (typo, or bad copypaste?).

Minor Warnings

On line 26, 38, 41, 159: Pointless quotes (arguments quoted but do not contain spaces).

Other Script Information

On line : (Statistics) Total structural lines: 37
On line : (Statistics) Total live code lines: 76
On line : (Statistics) Total comment lines: 27
On line : (Statistics) Total blank lines: 9

Shortened Lines

There are 6 lines that were merged into other lines.

drifting halo
#

lol you misspelled definitions on line 24

tall ravine
#

you should have warnings shown ^ if you set the script editor up

#

also define <[entity]>_dices: those def names should not have other defs inside them

drifting halo
#

o also

#

(Godline) Simple Dice Game

#

[review] naming convention is specifically for submissions to the forum, which uhh

#

could probably be a tag now?

#

idk i guess that's strictly Needs mcmonkey

#

anyway i digress

raven robin
raven robin
rapid temple
# gentle coral

First step is that ^, do you have your Denizen script editor setup?

raven robin
raven robin
rapid temple
#

On line 27, 29, 40, 43: Definition tag points to non-existent definition (typo, or bad copypaste?).
You misspelled definitions, so the script checker doesn't recognize them

#

On line 26, 38, 41, 159: Pointless quotes (arguments quoted but do not contain spaces).
Well, exactly what it says - you only need quotes if you have spaces in the argument, otherwise should leave them out

raven robin
# rapid temple > On line 27, 29, 40, 43: Definition tag points to non-existent definition (typo...

https://paste.denizenscript.com/View/107314 for example this code. It has warnings On line 6,7,8 Definition tag points to non-existent definition (typo, or bad copypaste?. But this code works fine, Server Logs: https://logpaste.com/LDTgUsgy . I can modify it https://paste.denizenscript.com/View/107315 and it has no warning, but what for if it works without added lines?

gentle coralBOT
# tall ravine !itworks
Info: itworks

Many newer scripters tend to not realize the important difference between "it works" and "it is correct". Just because a script works does not mean everything's fine.

Helpers are encouraged to refuse to continue helping a user with the "if it works it's good enough" mindset until they fix all the things that are wrong (but seem to work) in their script.

Read a longer writeup explaining this idea on the forum here: https://forum.denizenscript.com/threads/public-information-writeup-the-it-works-fallacy.265/

raven robin
# tall ravine !itworks

Ok. Understand. Make sense. Anyway, I'm just curious to know why it is necessary to define definitions that way.

raven robin
raven robin
#

Hello again. Could I ask for some help?
There is 3 questions:

  1. Is it possible to change lore of the item one by one on every click?
    What I mean: We have a list of lores (line 10 for example) and on every right click lore should changes one by one from list.
  2. Is it possible to set exact line of lore?
  3. On line 27 I've tried to make a matcher. If lore contains some word, do something. But it gives me an error that player.item_in_hand.lore doesnt return me lore as a list.

code:
https://paste.denizenscript.com/View/107424

error:
https://paste.denizenscript.com/View/107426

sly wigeon
raven robin
#

while removing DNS, found solution for a first point. But got another problem: How I can set click event right. If I click on entity script under click on air runs too https://paste.denizenscript.com/View/107437

void flame
#

I approached this the other day by defining:
- define target <context.location.material.name.if_null[air]> and then checking if it was air or some other block; you could probably simplify this to a higher level scope, but I was trying to determine the target.

<context.location> is undefined when this event triggers when targeting air

rapid temple
#

ooo wait, they do both fire at a very specific distance

#

That feels like a Paper/Spigot/Minecraft bug at this point

south grove
#

you'd need to ray_trace under clicks air and see if there is no entity in front of the player

#

wait this tag is better

#

!t precise_target

gentle coralBOT
# south grove !t precise_target
Cannot Specify Searched Tag

Multiple possible tags: <EntityTag.precise_target[(<range>)]>, <LocationTag.precise_target[(<range>)]>, <EntityTag.precise_target[(<range>)].type[<matcher>]>, <LocationTag.precise_target_list[<range>]>, <LocationTag.precise_target[(<range>)].type[<entity_type>|...]>, <EntityTag.precise_target_position[(<range>)]>, <LocationTag.precise_target_position[(<range>)]>, <EntityTag.precise_target_position[(<range>)].type[<matcher>]>, <LocationTag.precise_target_position[(<range>)].type[<entity_type>|...]>.

south grove
#

!t entity.precise_target

gentle coralBOT
grim totemBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@raven robin