Tutorials_for_BDFD

Dig Command

Oct 26th, 2024
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. $nomention
  2.  
  3. $c[!starthunt]
  4. $setServerVar[treasureX;$random[1;10]]
  5. $setServerVar[treasureY;$random[1;10]]
  6. $setServerVar[turns;5]
  7. $setServerVar[lastDig;0]
  8. The treasure hunt has begun! You have 5 turns to find the treasure on a 10x10 grid. Use !dig x y to dig at coordinates (x,y).
  9.  
  10. $c[!dig]
  11. $onlyIf[$getServerVar[turns]>0;The hunt is over. Use !starthunt to begin a new game.]
  12. $onlyIf[$message[1]!=;Please provide both x and y coordinates. Usage: !dig x y]
  13. $onlyIf[$message[2]!=;Please provide both x and y coordinates. Usage: !dig x y]
  14. $onlyIf[$checkCondition[$message[1]>=1]$checkCondition[$message[1]<=10]==truetrue;X coordinate must be between 1 and 10.]
  15. $onlyIf[$checkCondition[$message[2]>=1]$checkCondition[$message[2]<=10]==truetrue;Y coordinate must be between 1 and 10.]
  16.  
  17. $var[treasureX;$getServerVar[treasureX]]
  18. $var[treasureY;$getServerVar[treasureY]]
  19. $var[digX;$message[1]]
  20. $var[digY;$message[2]]
  21.  
  22. $var[distanceX;$sub[$var[treasureX];$var[digX]]]
  23. $var[distanceY;$sub[$var[treasureY];$var[digY]]]
  24. $var[distance;$sum[$if[$var[distanceX]<0;$multi[$var[distanceX];-1];$var[distanceX]];$if[$var[distanceY]<0;$multi[$var[distanceY];-1];$var[distanceY]]]]
  25.  
  26. $if[$checkCondition[$var[digX]==$var[treasureX]]$checkCondition[$var[digY]==$var[treasureY]]==truetrue]
  27. Congratulations! You found the treasure at ($var[digX],$var[digY])!
  28. $setServerVar[turns;0]
  29. $else
  30. $var[lastDistance;$getServerVar[lastDig]]
  31. $setServerVar[lastDig;$var[distance]]
  32. $setServerVar[turns;$sub[$getServerVar[turns];1]]
  33.  
  34. No treasure at ($var[digX],$var[digY]).
  35. $if[$getServerVar[turns]==0]
  36. Game over! The treasure was at ($var[treasureX],$var[treasureY]).
  37. $elseIf[$var[lastDistance]==0]
  38. Try again! You have $getServerVar[turns] turns left.
  39. $elseIf[$var[distance]<$var[lastDistance]]
  40. The treasure is getting warmer! It's near somewhere! You have $getServerVar[turns] turns left.
  41. $else
  42. The treasure is getting colder. It's going far! You have $getServerVar[turns] turns left.
  43. $endif
  44. $endif
  45.  
  46. $description[
  47. ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
  48. ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
  49. ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
  50. ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
  51. ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
  52. ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
  53. ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
  54. ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
  55. ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
  56. ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
  57. ]
Advertisement
Add Comment
Please, Sign In to add comment