- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register


Click here to create your own public paste ~ ~ click to duplicate and edit this paste


TitleScript
TypeDenizen Script
Date2017/05/08 10:31:28 UTC-07:00
ByGuest
Other
Paste
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
5200
sp_shop_inv_scroll_handler:
  type: world
  scroll_code:
  - narrate <&4><player.name>
  - flag player sp.current_page:<def[go_to_page]>
  - narrate "scroll_code"
  - if <yaml[sp].read[shops.<player.flag[sp.shopname]>.allow_qty_modify]||false> && <player.flag[sp.talking_to].as_npc.flag[sp.is_collecting]||false> {
    - if <player.has_flag[erpg_region> {
      - define item_list "<yaml[lt_<player>].read[shopinv.<player.flag[erpg_region]>.<proc[e-id]>]||li@i@dirt>"
      - narrate "load_regio"
      } else {
      - define item_list "<yaml[sp_playerdata].read[localshops.<player>.<npc>]||li@i@dirt>"
      - narrate "load_general"
      }
    - define from <player.flag[sp.current_page].sub[1].mul[45].add[1]>
    - define to <player.flag[sp.current_page].mul[45]>
    - define current_page_content "<def[item_list].get[<def[from]>].to[<def[to]>]>"
    - define current_page_content "<def[current_page_content].include[<s@sp_gt.constant[<el@45.sub[<def[current_page_content].size>]>]>]>"
    } else {
    - define item_list "<yaml[sp].read[shops.<player.flag[sp.shopname]>.fill_page_table.sites.<def[go_to_page]>.items]>"
    - define empty_slots "<el@45.sub[<def[item_list].size>]>"
    - define current_page_content "<def[item_list].include[<s@sp_gt.constant[<def[empty_slots]>]>]>"
    }
  - flag player "inv_data:<def[current_page_content].as_list>"
  - narrate "Gehe Seite <player.flag[sp.current_page]>/<player.flag[sp.pages_amount]>"
  - inventory open d:<def[shop_inventory]>
  scroll_left:
  - narrate "scroll_left"
  - define go_to_page "<player.flag[sp.current_page].sub[1]>"
  - if <def[go_to_page]> >= 1 {
    - inject locally path:scroll_code
    }
  scroll_right:
  - narrate "scroll_right"
  - define go_to_page "<player.flag[sp.current_page].add[1]>"
  - if <def[go_to_page]> <= <player.flag[sp.pages_amount]||1> {
    - inject locally path:scroll_code
    }
  events:
    on player clicks sp_scroll_left in sp_buy_inv:
    - define shop_inventory in@sp_buy_inv
    - inject locally path:scroll_left
    on player clicks sp_scroll_right in sp_buy_inv:
    - define shop_inventory in@sp_buy_inv
    - inject locally path:scroll_right
    on player clicks sp_scroll_left in sp_sell_inv:
    - define shop_inventory in@sp_sell_inv
    - inject locally path:scroll_left
    on player clicks sp_scroll_right in sp_sell_inv:
    - define shop_inventory in@sp_sell_inv
    - inject locally path:scroll_right



RawRaw



Pastes made: 75780