forked from BlackWolfWoof/yagpdb-cc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bypass_limit.yag
28 lines (23 loc) · 978 Bytes
/
bypass_limit.yag
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
{{/*
Usage:
This template is for advanced users that know what they are doing.
It can be used to for example get all entries from a specific database key without hitting some limits that you can reset via using execCC.
In the pre-made code you will get 10 entries from the key "test" every time it runs.
Code Example: A working code example with no additional setup can be found at https://github.com/BlackWolfWoof/yagpdb-cc/blob/master/Templates/bypass_limit_example.yag
Made by Black Wolf#0001
*/}}
{{$skip := 0}}{{$count := 0}}
{{if .ExecData}}
{{$skip = .ExecData.skip}}
{{end}}
{{range (dbTopEntries "test" 10 $skip)}}
{{sendMessage nil (print "Key from: `" .UserID "` the the value: " .Value)}}
{{$skip = add $skip 1}}
{{$count = add $count 1}}
{{end}}
{{/*If you got no entries from dbTopEntries $count will stay 0 and end the custom command*/}}
{{if ne $count 0}}
{{execCC .CCID nil 8 (sdict "skip" $skip)}}
{{else}}
{{sendMessage nil "Done!"}}
{{end}}